arguments-with-arguments-lex.js (891B)
1 // Copyright (C) 2016 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-functiondeclarationinstantiation 5 es6id: 9.2.12 6 description: > 7 Arguments object is created even when the body contains a function named 8 "arguments" 9 info: | 10 [...] 11 19. Else if "arguments" is an element of parameterNames, then 12 a. Let argumentsObjectNeeded be false. 13 20. Else if hasParameterExpressions is false, then 14 a. If "arguments" is an element of functionNames or if "arguments" is an 15 element of lexicalNames, then 16 i. Let argumentsObjectNeeded be false. 17 [...] 18 flags: [noStrict] 19 features: [generators] 20 ---*/ 21 22 var args; 23 24 var g = function* (x = args = arguments) { 25 let arguments; 26 }; 27 28 g().next(); 29 30 assert.sameValue(typeof args, 'object'); 31 assert.sameValue(args.length, 0); 32 33 reportCompare(0, 0);