| 1 |
// Copyright (C) 2016 the V8 project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
/*--- |
| 4 |
path: language/statements/for/dstr-var- |
| 5 |
name: for statement |
| 6 |
esid: sec-for-statement-runtime-semantics-labelledevaluation |
| 7 |
es6id: 13.7.4.7 |
| 8 |
features: [destructuring-binding] |
| 9 |
info: | |
| 10 |
IterationStatement : |
| 11 |
for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement |
| 12 |
|
| 13 |
1. Let varDcl be the result of evaluating VariableDeclarationList. |
| 14 |
[...] |
| 15 |
|
| 16 |
13.3.2.4 Runtime Semantics: Evaluation |
| 17 |
|
| 18 |
VariableDeclarationList : VariableDeclarationList , VariableDeclaration |
| 19 |
|
| 20 |
1. Let next be the result of evaluating VariableDeclarationList. |
| 21 |
2. ReturnIfAbrupt(next). |
| 22 |
3. Return the result of evaluating VariableDeclaration. |
| 23 |
|
| 24 |
VariableDeclaration : BindingPattern Initializer |
| 25 |
|
| 26 |
1. Let rhs be the result of evaluating Initializer. |
| 27 |
2. Let rval be GetValue(rhs). |
| 28 |
3. ReturnIfAbrupt(rval). |
| 29 |
4. Return the result of performing BindingInitialization for BindingPattern |
| 30 |
passing rval and undefined as arguments. |
| 31 |
---*/ |
| 32 |
|
| 33 |
function fn() { |
| 34 |
for (var /*{ elems }*/ = /*{ iter }*/; ; ) { |
| 35 |
return; |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
fn(); |
| 40 |
|
| 41 |
/*{ assertions }*/ |