ary-ptrn-elem-id-init-fn-name-gen.js (1406B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case 3 // - src/dstr-binding/default/try.template 4 /*--- 5 description: SingleNameBinding assigns name to "anonymous" generator functions (try statement) 6 esid: sec-runtime-semantics-catchclauseevaluation 7 features: [generators, destructuring-binding] 8 flags: [generated] 9 info: | 10 Catch : catch ( CatchParameter ) Block 11 12 [...] 13 5. Let status be the result of performing BindingInitialization for 14 CatchParameter passing thrownValue and catchEnv as arguments. 15 [...] 16 17 13.3.3.6 Runtime Semantics: IteratorBindingInitialization 18 19 SingleNameBinding : BindingIdentifier Initializeropt 20 21 [...] 22 6. If Initializer is present and v is undefined, then 23 a. Let defaultValue be the result of evaluating Initializer. 24 b. Let v be GetValue(defaultValue). 25 c. ReturnIfAbrupt(v). 26 d. If IsAnonymousFunctionDefinition(Initializer) is true, then 27 [...] 28 7. If environment is undefined, return PutValue(lhs, v). 29 8. Return InitializeReferencedBinding(lhs, v). 30 31 ---*/ 32 33 var ranCatch = false; 34 35 try { 36 throw []; 37 } catch ([gen = function* () {}, xGen = function* x() {}]) { 38 assert.sameValue(gen.name, 'gen'); 39 assert.notSameValue(xGen.name, 'xGen'); 40 ranCatch = true; 41 } 42 43 assert(ranCatch, 'executed `catch` block'); 44 45 reportCompare(0, 0);