mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
48 lines
946 B
JavaScript
48 lines
946 B
JavaScript
// Copyright (C) 2015 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
es6id: 14.4.13
|
|
description: >
|
|
Assignment of function `name` attribute (GeneratorMethod)
|
|
info: |
|
|
GeneratorMethod :
|
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
|
|
|
[...]
|
|
9. Perform SetFunctionName(closure, propKey).
|
|
includes: [propertyHelper.js]
|
|
features: [generators, Symbol]
|
|
---*/
|
|
|
|
var namedSym = Symbol('test262');
|
|
var anonSym = Symbol();
|
|
var o;
|
|
|
|
o = {
|
|
*id() {},
|
|
*[anonSym]() {},
|
|
*[namedSym]() {}
|
|
};
|
|
|
|
verifyProperty(o.id, 'name', {
|
|
value: 'id',
|
|
writable: false,
|
|
enumerable: false,
|
|
configurable: true,
|
|
});
|
|
|
|
verifyProperty(o[anonSym], 'name', {
|
|
value: '',
|
|
writable: false,
|
|
enumerable: false,
|
|
configurable: true,
|
|
});
|
|
|
|
verifyProperty(o[namedSym], 'name', {
|
|
value: '[test262]',
|
|
writable: false,
|
|
enumerable: false,
|
|
configurable: true,
|
|
});
|