| 1 |
// This file was procedurally generated from the following sources: |
| 2 |
// - src/dstr-assignment/obj-id-init-fn-name-fn.case |
| 3 |
// - src/dstr-assignment/default/assignment-expr.template |
| 4 |
/*--- |
| 5 |
description: Assignment of function `name` attribute (FunctionExpression) (AssignmentExpression) |
| 6 |
esid: sec-variable-statement-runtime-semantics-evaluation |
| 7 |
es6id: 13.3.2.4 |
| 8 |
features: [destructuring-binding] |
| 9 |
flags: [generated] |
| 10 |
includes: [propertyHelper.js] |
| 11 |
info: | |
| 12 |
VariableDeclaration : BindingPattern Initializer |
| 13 |
|
| 14 |
1. Let rhs be the result of evaluating Initializer. |
| 15 |
2. Let rval be GetValue(rhs). |
| 16 |
3. ReturnIfAbrupt(rval). |
| 17 |
4. Return the result of performing BindingInitialization for |
| 18 |
BindingPattern passing rval and undefined as arguments. |
| 19 |
|
| 20 |
AssignmentProperty : IdentifierReference Initializeropt |
| 21 |
[...] 6. If Initializeropt is present and v is undefined, then |
| 22 |
[...] |
| 23 |
d. If IsAnonymousFunctionDefinition(Initializer) is true, then |
| 24 |
i. Let hasNameProperty be HasOwnProperty(v, "name"). |
| 25 |
ii. ReturnIfAbrupt(hasNameProperty). |
| 26 |
iii. If hasNameProperty is false, perform SetFunctionName(v, P). |
| 27 |
|
| 28 |
---*/ |
| 29 |
var xFn, fn; |
| 30 |
|
| 31 |
var result; |
| 32 |
var vals = {}; |
| 33 |
|
| 34 |
result = { xFn = function x() {}, fn = function() {} } = vals; |
| 35 |
|
| 36 |
assert.notSameValue(xFn.name, 'xFn'); |
| 37 |
|
| 38 |
verifyProperty(fn, 'name', { |
| 39 |
enumerable: false, |
| 40 |
writable: false, |
| 41 |
configurable: true, |
| 42 |
value: 'fn' |
| 43 |
}); |
| 44 |
|
| 45 |
assert.sameValue(result, vals); |