nameless-dflt-params-abrupt.js (1416B)
1 // |reftest| async 2 // This file was procedurally generated from the following sources: 3 // - src/function-forms/dflt-params-abrupt.case 4 // - src/function-forms/error/async-func-expr-nameless.template 5 /*--- 6 description: Abrupt completion returned by evaluation of initializer (async function nameless expression) 7 esid: sec-async-function-definitions 8 features: [default-parameters, async-functions] 9 flags: [generated, async] 10 info: | 11 14.6 Async Function Definitions 12 13 AsyncFunctionExpression : 14 async function ( FormalParameters ) { AsyncFunctionBody } 15 16 17 14.1.19 Runtime Semantics: IteratorBindingInitialization 18 19 FormalsList : FormalsList , FormalParameter 20 21 1. Let status be the result of performing IteratorBindingInitialization for 22 FormalsList using iteratorRecord and environment as the arguments. 23 2. ReturnIfAbrupt(status). 24 3. Return the result of performing IteratorBindingInitialization for 25 FormalParameter using iteratorRecord and environment as the arguments. 26 27 ---*/ 28 29 30 var callCount = 0; 31 var f = async function(_ = (function() { throw new Test262Error(); }())) { 32 33 callCount = callCount + 1; 34 } 35 36 f() 37 .then(_ => { 38 throw new Test262Error('function should not be resolved'); 39 }, error => assert.sameValue(error.constructor, Test262Error)) 40 .then(() => { 41 assert.sameValue(callCount, 0, 'function body is not evaluated'); 42 }, $DONE) 43 .then($DONE, $DONE);