tests/auto/qml/ecmascripttests/test262/test/language/statements/let/dstr-ary-ptrn-elem-id-init-fn-name-cover.js
raw symbols SCIP| 1 | // This file was procedurally generated from the following sources: |
| 2 | // - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case |
| 3 | // - src/dstr-binding/default/let-stmt.template |
| 4 | /*--- |
| 5 | description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (`let` statement) |
| 6 | esid: sec-let-and-const-declarations-runtime-semantics-evaluation |
| 7 | es6id: 13.3.1.4 |
| 8 | features: [destructuring-binding] |
| 9 | flags: [generated] |
| 10 | info: | |
| 11 | LexicalBinding : BindingPattern Initializer |
| 12 | |
| 13 | 1. Let rhs be the result of evaluating Initializer. |
| 14 | 2. Let value be GetValue(rhs). |
| 15 | 3. ReturnIfAbrupt(value). |
| 16 | 4. Let env be the running execution context's LexicalEnvironment. |
| 17 | 5. Return the result of performing BindingInitialization for BindingPattern |
| 18 | using value and env as the arguments. |
| 19 | |
| 20 | 13.3.3.6 Runtime Semantics: IteratorBindingInitialization |
| 21 | |
| 22 | SingleNameBinding : BindingIdentifier Initializeropt |
| 23 | |
| 24 | [...] |
| 25 | 6. If Initializer is present and v is undefined, then |
| 26 | a. Let defaultValue be the result of evaluating Initializer. |
| 27 | b. Let v be GetValue(defaultValue). |
| 28 | c. ReturnIfAbrupt(v). |
| 29 | d. If IsAnonymousFunctionDefinition(Initializer) is true, then |
| 30 | [...] |
| 31 | 7. If environment is undefined, return PutValue(lhs, v). |
| 32 | 8. Return InitializeReferencedBinding(lhs, v). |
| 33 | ---*/ |
| 34 | |
| 35 | let [cover = (function () {}), xCover = (0, function() {})] = []; |
| 36 | |
| 37 | assert.sameValue(cover.name, 'cover'); |
| 38 | assert.notSameValue(xCover.name, 'xCover'); |