dflt-params-abrupt.js (1434B)
1 // This file was procedurally generated from the following sources: 2 // - src/function-forms/dflt-params-abrupt.case 3 // - src/function-forms/error/async-gen-func-expr.template 4 /*--- 5 description: Abrupt completion returned by evaluation of initializer (async generator function expression) 6 esid: sec-asyncgenerator-definitions-evaluation 7 features: [default-parameters, async-iteration] 8 flags: [generated] 9 info: | 10 AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { 11 AsyncGeneratorBody } 12 13 [...] 14 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, 15 AsyncGeneratorBody, scope, strict). 16 [...] 17 18 19 14.1.19 Runtime Semantics: IteratorBindingInitialization 20 21 FormalsList : FormalsList , FormalParameter 22 23 1. Let status be the result of performing IteratorBindingInitialization for 24 FormalsList using iteratorRecord and environment as the arguments. 25 2. ReturnIfAbrupt(status). 26 3. Return the result of performing IteratorBindingInitialization for 27 FormalParameter using iteratorRecord and environment as the arguments. 28 29 ---*/ 30 31 32 var callCount = 0; 33 var f; 34 f = async function*(_ = (function() { throw new Test262Error(); }())) { 35 36 callCount = callCount + 1; 37 }; 38 39 assert.throws(Test262Error, function() { 40 f(); 41 }); 42 assert.sameValue(callCount, 0, 'generator function body not evaluated'); 43 44 reportCompare(0, 0);