keith_miller@apple.com | bcc77f2 | 2016-07-15 06:03:25 +0000 | [diff] [blame] | 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/dstr-assignment/array-elem-init-fn-name-arrow.case |
| 3 | // - src/dstr-assignment/default/assignment-expr.template |
| 4 | /*--- |
| 5 | description: Assignment of function `name` attribute (ArrowFunction) (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 | AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt |
| 21 | [...] 7. If Initializer is present and value is undefined and |
| 22 | IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of |
| 23 | DestructuringAssignmentTarget are both true, then |
| 24 | a. Let hasNameProperty be HasOwnProperty(v, "name"). |
| 25 | b. ReturnIfAbrupt(hasNameProperty). |
| 26 | c. If hasNameProperty is false, perform SetFunctionName(v, |
| 27 | GetReferencedName(lref)). |
| 28 | |
| 29 | ---*/ |
| 30 | var arrow; |
| 31 | |
| 32 | var result; |
| 33 | var vals = []; |
| 34 | |
| 35 | result = [ arrow = () => {} ] = vals; |
| 36 | |
| 37 | assert.sameValue(arrow.name, 'arrow'); |
| 38 | verifyNotEnumerable(arrow, 'name'); |
| 39 | verifyNotWritable(arrow, 'name'); |
| 40 | verifyConfigurable(arrow, 'name'); |
| 41 | |
| 42 | assert.sameValue(result, vals); |