name.js (1413B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-generator-function-definitions-runtime-semantics-evaluation 6 description: Assignment of function `name` attribute 7 info: | 8 GeneratorExpression : function * ( FormalParameters ) { GeneratorBody } 9 10 1. Let scope be the LexicalEnvironment of the running execution context. 11 2. Let closure be GeneratorFunctionCreate(Normal, FormalParameters, 12 GeneratorBody, scope, ""). 13 ... 14 6. Return closure. 15 16 GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody } 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, false). 23 6. Let closure be GeneratorFunctionCreate(Normal, FormalParameters, 24 GeneratorBody, funcEnv, name). 25 ... 26 11. Return closure. 27 includes: [propertyHelper.js] 28 features: [generators] 29 ---*/ 30 31 verifyProperty(function*() {}, "name", { 32 value: "", writable: false, enumerable: false, configurable: true 33 }); 34 35 verifyProperty(function* func() {}, "name", { 36 value: "func", writable: false, enumerable: false, configurable: true 37 }); 38 39 reportCompare(0, 0);