async-gen-meth-ary-ptrn-rest-id-elision-next-err.js (1689B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case 3 // - src/dstr-binding/error/async-gen-meth.template 4 /*--- 5 description: Rest element following elision elements (async generator method) 6 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation 7 features: [generators, async-iteration] 8 flags: [generated] 9 info: | 10 AsyncGeneratorMethod : 11 async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) 12 { AsyncGeneratorBody } 13 14 1. Let propKey be the result of evaluating PropertyName. 15 2. ReturnIfAbrupt(propKey). 16 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. 17 Otherwise let strict be false. 18 4. Let scope be the running execution context's LexicalEnvironment. 19 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, 20 AsyncGeneratorBody, scope, strict). 21 [...] 22 23 13.3.3.6 Runtime Semantics: IteratorBindingInitialization 24 ArrayBindingPattern : [ Elisionopt BindingRestElement ] 25 1. If Elision is present, then 26 a. Let status be the result of performing 27 IteratorDestructuringAssignmentEvaluation of Elision with 28 iteratorRecord as the argument. 29 b. ReturnIfAbrupt(status). 30 2. Return the result of performing IteratorBindingInitialization for 31 BindingRestElement with iteratorRecord and environment as arguments. 32 33 ---*/ 34 var iter = (function*() { throw new Test262Error(); })(); 35 36 37 var obj = { 38 async *method([, ...x]) { 39 40 } 41 }; 42 43 assert.throws(Test262Error, function() { 44 obj.method(iter); 45 }); 46 47 reportCompare(0, 0);