dflt-ary-ptrn-rest-init-ary.js (1807B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/dstr-binding/ary-ptrn-rest-init-ary.case 4 // - src/dstr-binding/default/arrow-function-dflt.template 5 /*--- 6 description: Rest element (nested array pattern) does not support initializer (arrow function expression (default parameter)) 7 esid: sec-arrow-function-definitions-runtime-semantics-evaluation 8 features: [destructuring-binding, default-parameters] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ArrowFunction : ArrowParameters => ConciseBody 15 16 [...] 17 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict). 18 [...] 19 20 9.2.1 [[Call]] ( thisArgument, argumentsList) 21 22 [...] 23 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). 24 [...] 25 26 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 27 28 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). 29 [...] 30 31 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) 32 33 [...] 34 23. Let iteratorRecord be Record {[[iterator]]: 35 CreateListIterator(argumentsList), [[done]]: false}. 36 24. If hasDuplicates is true, then 37 [...] 38 25. Else, 39 b. Let formalStatus be IteratorBindingInitialization for formals with 40 iteratorRecord and env as arguments. 41 [...] 42 43 13.3.3 Destructuring Binding Patterns 44 ArrayBindingPattern[Yield] : 45 [ Elisionopt BindingRestElement[?Yield]opt ] 46 [ BindingElementList[?Yield] ] 47 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] 48 ---*/ 49 $DONOTEVALUATE(); 50 51 var callCount = 0; 52 var f; 53 f = ([...[ x ] = []] = []) => { 54 55 callCount = callCount + 1; 56 }; 57 58 f(); 59 assert.sameValue(callCount, 1, 'arrow function invoked exactly once');