dflt-params-abrupt.js (2519B)
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/cls-expr-async-meth-static.template 5 /*--- 6 description: Abrupt completion returned by evaluation of initializer (static class expression async method) 7 esid: sec-class-definitions-runtime-semantics-evaluation 8 features: [default-parameters, async-functions] 9 flags: [generated, async] 10 info: | 11 ClassExpression : class BindingIdentifieropt ClassTail 12 13 1. If BindingIdentifieropt is not present, let className be undefined. 14 2. Else, let className be StringValue of BindingIdentifier. 15 3. Let value be the result of ClassDefinitionEvaluation of ClassTail 16 with argument className. 17 [...] 18 19 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 20 21 21. For each ClassElement m in order from methods 22 a. If IsStatic of m is false, then 23 b. Else, 24 Let status be the result of performing PropertyDefinitionEvaluation 25 for m with arguments F and false. 26 [...] 27 28 Runtime Semantics: PropertyDefinitionEvaluation 29 30 AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 31 32 1. Let propKey be the result of evaluating PropertyName. 33 2. ReturnIfAbrupt(propKey). 34 3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise 35 let strict be false. 36 4. Let scope be the LexicalEnvironment of the running execution context. 37 5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody, 38 scope, strict). 39 [...] 40 41 42 14.1.19 Runtime Semantics: IteratorBindingInitialization 43 44 FormalsList : FormalsList , FormalParameter 45 46 1. Let status be the result of performing IteratorBindingInitialization for 47 FormalsList using iteratorRecord and environment as the arguments. 48 2. ReturnIfAbrupt(status). 49 3. Return the result of performing IteratorBindingInitialization for 50 FormalParameter using iteratorRecord and environment as the arguments. 51 52 ---*/ 53 54 55 var callCount = 0; 56 57 var C = class { 58 static async method(_ = (function() { throw new Test262Error(); }())) { 59 60 callCount = callCount + 1; 61 } 62 }; 63 64 C.method() 65 .then(_ => { 66 throw new Test262Error('function should not be resolved'); 67 }, error => assert.sameValue(error.constructor, Test262Error)) 68 .then(() => { 69 assert.sameValue(callCount, 0, 'function body is not evaluated'); 70 }, $DONE) 71 .then($DONE, $DONE);