async-gen-meth-obj-ptrn-prop-id-init-unresolvable.js (1681B)
1 // This file was procedurally generated from the following sources: 2 // - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case 3 // - src/dstr-binding/error/async-gen-meth.template 4 /*--- 5 description: Destructuring initializer is an unresolvable reference (async generator method) 6 esid: sec-asyncgenerator-definitions-propertydefinitionevaluation 7 features: [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.7 Runtime Semantics: KeyedBindingInitialization 24 25 BindingElement : BindingPattern Initializeropt 26 27 [...] 28 3. If Initializer is present and v is undefined, then 29 a. Let defaultValue be the result of evaluating Initializer. 30 b. Let v be GetValue(defaultValue). 31 c. ReturnIfAbrupt(v). 32 33 6.2.3.1 GetValue (V) 34 35 1. ReturnIfAbrupt(V). 36 2. If Type(V) is not Reference, return V. 37 3. Let base be GetBase(V). 38 4. If IsUnresolvableReference(V), throw a ReferenceError exception. 39 ---*/ 40 41 42 var obj = { 43 async *method({ x: y = unresolvableReference }) { 44 45 } 46 }; 47 48 assert.throws(ReferenceError, function() { 49 obj.method({}); 50 }); 51 52 reportCompare(0, 0);