blob: f97fdd5676a966e3a157ef2a83e637be4b87a3a7 (
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
33
|
// 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 lexically-scoped
binding 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]
features: [generators]
---*/
var args;
function* g(x = args = arguments) {
function arguments() {}
}
g().next();
assert.sameValue(typeof args, 'object');
assert.sameValue(args.length, 0);
reportCompare(0, 0);
|