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.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
es6id: 12.2.6.9
|
|
|
|
description: Assignment of function `name` attribute (MethodDefinition)
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2015-07-08 22:09:57 +02:00
|
|
|
6. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
|
|
|
|
a. Let hasNameProperty be HasOwnProperty(propValue, "name").
|
|
|
|
b. ReturnIfAbrupt(hasNameProperty).
|
|
|
|
c. If hasNameProperty is false, perform SetFunctionName(propValue,
|
|
|
|
propKey).
|
|
|
|
includes: [propertyHelper.js]
|
|
|
|
features: [Symbol]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
var namedSym = Symbol('test262');
|
|
|
|
var anonSym = Symbol();
|
|
|
|
|
|
|
|
class A {
|
|
|
|
id() {}
|
|
|
|
[anonSym]() {}
|
|
|
|
[namedSym]() {}
|
|
|
|
static id() {}
|
|
|
|
static [anonSym]() {}
|
|
|
|
static [namedSym]() {}
|
|
|
|
}
|
|
|
|
|
2023-09-11 14:13:50 +02:00
|
|
|
verifyProperty(A.prototype.id, 'name', {
|
|
|
|
value: 'id',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
verifyProperty(A.prototype[anonSym], 'name', {
|
|
|
|
value: '',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
verifyProperty(A.prototype[namedSym], 'name', {
|
|
|
|
value: '[test262]',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
verifyProperty(A.id, 'name', {
|
|
|
|
value: 'id',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
verifyProperty(A[anonSym], 'name', {
|
|
|
|
value: '',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
verifyProperty(A[namedSym], 'name', {
|
|
|
|
value: '[test262]',
|
|
|
|
writable: false,
|
|
|
|
enumerable: false,
|
|
|
|
configurable: true,
|
|
|
|
});
|