summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/function/arguments-with-arguments-lex.js
blob: 4b5d0f083f8a1ef9caae037004cd8a6a17d8460f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-functiondeclarationinstantiation
es6id: 9.2.12
description: >
  Arguments object is created even when the body contains a function named
  "arguments"
info: |
  [...]
  19. Else if "arguments" is an element of parameterNames, then
      a. Let argumentsObjectNeeded be false.
  20. Else if hasParameterExpressions is false, then
      a. If "arguments" is an element of functionNames or if "arguments" is an
         element of lexicalNames, then
         i. Let argumentsObjectNeeded be false.
  [...]
flags: [noStrict]
---*/

var args;

var f = function (x = args = arguments) {
  let arguments;
};

f();

assert.sameValue(typeof args, 'object');
assert.sameValue(args.length, 0);

reportCompare(0, 0);