arguments-with-arguments-fn.js (883B)
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 lexically-scoped 8 binding named "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 ---*/ 20 21 var args; 22 23 var f = function(x = args = arguments) { 24 function arguments() {} 25 }; 26 27 f(); 28 29 assert.sameValue(typeof args, 'object'); 30 assert.sameValue(args.length, 0); 31 32 reportCompare(0, 0);