Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/fn-name-cover.js

raw
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 es6id: 12.14.4
6 description: >
7 Assignment of function `name` attribute (CoverParenthesizedExpression)
8 info: |
9 AssignmentExpression[In, Yield] :
10 LeftHandSideExpression[?Yield] = AssignmentExpression[?In, ?Yield]
11
12 1. If LeftHandSideExpression is neither an ObjectLiteral nor an
13 ArrayLiteral, then
14 [...]
15 e. If IsAnonymousFunctionDefinition(AssignmentExpression) and
16 IsIdentifierRef of LeftHandSideExpression are both true, then
17
18 i. Let hasNameProperty be HasOwnProperty(rval, "name").
19 ii. ReturnIfAbrupt(hasNameProperty).
20 iii. If hasNameProperty is false, perform SetFunctionName(rval,
21 GetReferencedName(lref)).
22 includes: [propertyHelper.js]
23 ---*/
24
25 var xCover, cover;
26
27 xCover = (0, function() {});
28 cover = (function() {});
29
30 assert(xCover.name !== 'xCover');
31
32 assert.sameValue(cover.name, 'cover');
33 verifyNotEnumerable(cover, 'name');
34 verifyNotWritable(cover, 'name');
35 verifyConfigurable(cover, 'name');