ary-ptrn-rest-init-id.js (1130B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/dstr-binding/ary-ptrn-rest-init-id.case 4 // - src/dstr-binding/default/const-stmt.template 5 /*--- 6 description: Rest element (identifier) does not support initializer (`const` statement) 7 esid: sec-let-and-const-declarations-runtime-semantics-evaluation 8 features: [destructuring-binding] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 LexicalBinding : BindingPattern Initializer 15 16 1. Let rhs be the result of evaluating Initializer. 17 2. Let value be GetValue(rhs). 18 3. ReturnIfAbrupt(value). 19 4. Let env be the running execution context's LexicalEnvironment. 20 5. Return the result of performing BindingInitialization for BindingPattern 21 using value and env as the arguments. 22 23 13.3.3 Destructuring Binding Patterns 24 ArrayBindingPattern[Yield] : 25 [ Elisionopt BindingRestElement[?Yield]opt ] 26 [ BindingElementList[?Yield] ] 27 [ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ] 28 ---*/ 29 $DONOTEVALUATE(); 30 31 const [...x = []] = [];