arrowparameters-cover-includes-rest-concisebody-functionbody.js (666B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 es6id: 14.2 5 description: > 6 ArrowFunction[In, Yield] : 7 ArrowParameters[?Yield] [no LineTerminator here] => ConciseBody[?In] 8 9 LineTerminator between arrow and ConciseBody[?In] 10 ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList[?Yield] 11 ConciseBody[In] : { FunctionBody } 12 13 Includes ...rest 14 ---*/ 15 var af = (x, ...y) => { return [x, y.length]; }; 16 17 assert.sameValue(typeof af, "function"); 18 assert.sameValue(af(1, 1, 1)[0], 1); 19 assert.sameValue(af(1, 1, 1)[1], 2); 20 21 reportCompare(0, 0);