via-params-rest.js (726B)
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 are "unmapped" when paramater list is non-simple due to "rest" 8 parameter 9 info: | 10 [...] 11 9. Let simpleParameterList be IsSimpleParameterList of formals. 12 [...] 13 22. If argumentsObjectNeeded is true, then 14 a. If strict is true or if simpleParameterList is false, then 15 i. Let ao be CreateUnmappedArgumentsObject(argumentsList). 16 [...] 17 ---*/ 18 19 var value; 20 21 function rest(a, ...b) { 22 arguments[0] = 2; 23 value = a; 24 } 25 26 rest(1); 27 28 assert.sameValue(value, 1); 29 30 reportCompare(0, 0);