name.js (1412B)
1 // Copyright (C) 2019 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-async-function-definitions-runtime-semantics-evaluation 6 description: Assignment of function `name` attribute 7 info: | 8 AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody } 9 10 1. Let scope be the LexicalEnvironment of the running execution context. 11 2. Let closure be ! AsyncFunctionCreate(Normal, FormalParameters, 12 AsyncFunctionBody, scope, ""). 13 ... 14 4. Return closure. 15 16 AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody } 17 18 1. Let scope be the running execution context's LexicalEnvironment. 19 2. Let funcEnv be ! NewDeclarativeEnvironment(scope). 20 3. Let envRec be funcEnv's EnvironmentRecord. 21 4. Let name be StringValue of BindingIdentifier. 22 5. Perform ! envRec.CreateImmutableBinding(name). 23 6. Let closure be ! AsyncFunctionCreate(Normal, FormalParameters, 24 AsyncFunctionBody, funcEnv, name). 25 ... 26 9. Return closure. 27 includes: [propertyHelper.js] 28 ---*/ 29 30 verifyProperty(async function() {}, "name", { 31 value: "", writable: false, enumerable: false, configurable: true 32 }); 33 34 verifyProperty(async function func() {}, "name", { 35 value: "func", writable: false, enumerable: false, configurable: true 36 }); 37 38 reportCompare(0, 0);