Generate tests

This commit is contained in:
Leo Balter 2017-05-15 15:25:33 -04:00
parent 59d9d0b6d8
commit 5204678e8f
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B
24 changed files with 1268 additions and 0 deletions

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement in an async function)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (const [,] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement in an async function)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (const [...x] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (let [,] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (let [...x] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( var ForBinding of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (var [,] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-func-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( var ForBinding of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function fn() {
for await (var [...x] of [iter]) {
return;
}
}
fn()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (const [,] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (const [...x] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (let [,] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,55 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( ForDeclaration of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (let [...x] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,52 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( var ForBinding of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (var [,] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,52 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-await-of-async-gen-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-await-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
features: [destructuring-binding, async-iteration]
flags: [generated, async]
info: |
IterationStatement :
for await ( var ForBinding of AssignmentExpression ) Statement
[...]
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet, async).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
4. Let destructuring be IsDestructuring of lhs.
[...]
6. Repeat
[...]
j. If destructuring is false, then
[...]
k. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
async function* fn() {
for await (var [...x] of [iter]) {
return;
}
}
fn()
.next()
.then(() => {
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');
})
.then($DONE, $DONE);

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-of-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( ForDeclaration of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (const [,] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-of-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( ForDeclaration of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (const [...x] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-of-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( ForDeclaration of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (let [,] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-of-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( ForDeclaration of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
lexicalBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
[...]
iii. Else,
1. Assert: lhsKind is lexicalBinding.
2. Assert: lhs is a ForDeclaration.
3. Let status be the result of performing BindingInitialization
for lhs passing nextValue and iterationEnv as arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (let [...x] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-of-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( var ForBinding of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (var [,] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-of-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for-of statement)
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
es6id: 13.7.5.11
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( var ForBinding of AssignmentExpression ) Statement
[...]
3. Return ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
varBinding, labelSet).
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
[...]
3. Let destructuring be IsDestructuring of lhs.
[...]
5. Repeat
[...]
h. If destructuring is false, then
[...]
i. Else
i. If lhsKind is assignment, then
[...]
ii. Else if lhsKind is varBinding, then
1. Assert: lhs is a ForBinding.
2. Let status be the result of performing BindingInitialization
for lhs passing nextValue and undefined as the arguments.
[...]
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (var [...x] of [iter]) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
[...]
7. Let forDcl be the result of evaluating LexicalDeclaration.
[...]
LexicalDeclaration : LetOrConst BindingList ;
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return NormalCompletion(empty).
BindingList : BindingList , LexicalBinding
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating LexicalBinding.
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution contexts LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (const [,] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-const.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
[...]
7. Let forDcl be the result of evaluating LexicalDeclaration.
[...]
LexicalDeclaration : LetOrConst BindingList ;
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return NormalCompletion(empty).
BindingList : BindingList , LexicalBinding
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating LexicalBinding.
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution contexts LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (const [...x] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
[...]
7. Let forDcl be the result of evaluating LexicalDeclaration.
[...]
LexicalDeclaration : LetOrConst BindingList ;
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return NormalCompletion(empty).
BindingList : BindingList , LexicalBinding
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating LexicalBinding.
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution contexts LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (let [,] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,53 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-let.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
[...]
7. Let forDcl be the result of evaluating LexicalDeclaration.
[...]
LexicalDeclaration : LetOrConst BindingList ;
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return NormalCompletion(empty).
BindingList : BindingList , LexicalBinding
1. Let next be the result of evaluating BindingList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating LexicalBinding.
LexicalBinding : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let value be GetValue(rhs).
3. ReturnIfAbrupt(value).
4. Let env be the running execution contexts LexicalEnvironment.
5. Return the result of performing BindingInitialization for BindingPattern
using value and env as the arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (let [...x] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-elision-iter-close.case
// - src/dstr-binding/iter-close/for-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
1. Let varDcl be the result of evaluating VariableDeclarationList.
[...]
13.3.2.4 Runtime Semantics: Evaluation
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
1. Let next be the result of evaluating VariableDeclarationList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating VariableDeclaration.
VariableDeclaration : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let rval be GetValue(rhs).
3. ReturnIfAbrupt(rval).
4. Return the result of performing BindingInitialization for BindingPattern
passing rval and undefined as arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (var [,] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-ptrn-rest-id-iter-close.case
// - src/dstr-binding/iter-close/for-var.template
/*---
description: The iterator is properly consumed by the destructuring pattern (for statement)
esid: sec-for-statement-runtime-semantics-labelledevaluation
es6id: 13.7.4.7
features: [destructuring-binding]
flags: [generated]
info: |
IterationStatement :
for ( var VariableDeclarationList ; Expressionopt ; Expressionopt ) Statement
1. Let varDcl be the result of evaluating VariableDeclarationList.
[...]
13.3.2.4 Runtime Semantics: Evaluation
VariableDeclarationList : VariableDeclarationList , VariableDeclaration
1. Let next be the result of evaluating VariableDeclarationList.
2. ReturnIfAbrupt(next).
3. Return the result of evaluating VariableDeclaration.
VariableDeclaration : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let rval be GetValue(rhs).
3. ReturnIfAbrupt(rval).
4. Return the result of performing BindingInitialization for BindingPattern
passing rval and undefined as arguments.
---*/
const iter = (function* () {
yield;
yield;
})();
function fn() {
for (var [...x] = iter; ; ) {
return;
}
}
fn();
assert.sameValue(iter.next().done, true, 'iteration occurred as expected');