2017-04-16 23:25:02 +02:00
|
|
|
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
2015-07-08 22:09:57 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2015-02-18 02:26:24 +01:00
|
|
|
|
|
|
|
/*---
|
2019-08-15 16:58:40 +02:00
|
|
|
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
2015-07-08 22:09:57 +02:00
|
|
|
description: Assignment of function `name` attribute
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2015-07-08 22:09:57 +02:00
|
|
|
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
|
|
|
|
|
2019-08-15 16:58:40 +02:00
|
|
|
1. Let scope be the LexicalEnvironment of the running execution context.
|
|
|
|
2. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
|
|
|
|
GeneratorBody, scope, "").
|
|
|
|
...
|
2015-07-08 22:09:57 +02:00
|
|
|
6. Return closure.
|
2015-02-18 02:26:24 +01:00
|
|
|
|
2015-07-08 22:09:57 +02:00
|
|
|
GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
|
2015-02-18 02:26:24 +01:00
|
|
|
|
2019-08-15 16:58:40 +02:00
|
|
|
1. Let scope be the running execution context's LexicalEnvironment.
|
|
|
|
2. Let funcEnv be NewDeclarativeEnvironment(scope).
|
|
|
|
3. Let envRec be funcEnv's EnvironmentRecord.
|
|
|
|
4. Let name be StringValue of BindingIdentifier.
|
|
|
|
5. Perform envRec.CreateImmutableBinding(name, false).
|
|
|
|
6. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
|
|
|
|
GeneratorBody, funcEnv, name).
|
|
|
|
...
|
|
|
|
11. Return closure.
|
2015-07-08 22:09:57 +02:00
|
|
|
includes: [propertyHelper.js]
|
2017-10-04 22:12:34 +02:00
|
|
|
features: [generators]
|
2015-07-08 22:09:57 +02:00
|
|
|
---*/
|
2015-02-18 02:26:24 +01:00
|
|
|
|
2019-08-15 16:58:40 +02:00
|
|
|
verifyProperty(function*() {}, "name", {
|
|
|
|
value: "", writable: false, enumerable: false, configurable: true
|
|
|
|
});
|
2015-02-18 02:26:24 +01:00
|
|
|
|
2019-08-15 16:58:40 +02:00
|
|
|
verifyProperty(function* func() {}, "name", {
|
|
|
|
value: "func", writable: false, enumerable: false, configurable: true
|
|
|
|
});
|