mirror of
https://github.com/tc39/test262.git
synced 2025-12-16 02:03:36 +01:00
* Add missing generators feature flags * Generate files * Add generators flags * fixup! Add generators flags
29 lines
907 B
Plaintext
29 lines
907 B
Plaintext
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
desc: SingleNameBinding assigns name to "anonymous" generator functions
|
|
template: default
|
|
info: |
|
|
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
|
|
|
SingleNameBinding : BindingIdentifier Initializer_opt
|
|
|
|
[...]
|
|
6. If Initializer is present and v is undefined, then
|
|
[...]
|
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
|
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
|
ii. ReturnIfAbrupt(hasNameProperty).
|
|
iii. If hasNameProperty is false, perform SetFunctionName(v,
|
|
bindingId).
|
|
features: [generators]
|
|
---*/
|
|
|
|
//- elems
|
|
{ gen = function* () {}, xGen = function* x() {} }
|
|
//- vals
|
|
{}
|
|
//- body
|
|
assert.sameValue(gen.name, 'gen');
|
|
assert.notSameValue(xGen.name, 'xGen');
|