mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
Generate tests
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
3bff862ca7
commit
670731a25e
@ -0,0 +1,47 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-assignment.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let v2, vNull, vHole, vUndefined, vOob;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([v2 = 10, vNull = 11, vHole = 12, vUndefined = 13, vOob = 14] of [[2, null, , undefined]]) {
|
||||
assert.sameValue(v2, 2);
|
||||
assert.sameValue(vNull, null);
|
||||
assert.sameValue(vHole, 12);
|
||||
assert.sameValue(vUndefined, 13);
|
||||
assert.sameValue(vOob, 14);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-init-evaluation-fn.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-init-evaluation.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement)
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,10 +24,10 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var flag1 = false, flag2 = false;
|
||||
var _;
|
||||
let flag1 = false, flag2 = false;
|
||||
let _;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ _ = flag1 = true, _ = flag2 = true ] of [[14]]) {
|
||||
assert.sameValue(flag1, false);
|
||||
@ -38,7 +38,9 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
@ -0,0 +1,54 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-fn-name-arrow.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ArrowFunction) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 7. If Initializer is present and value is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(v, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let arrow;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ arrow = () => {} ] of [[]]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,59 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-fn-name-class.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ClassExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [class, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 7. If Initializer is present and value is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(v, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let xCls, cls, xCls2;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ xCls = class x {}, cls = class {}, xCls2 = class { static name() {} } ] of [[]]) {
|
||||
assert(xCls.name !== 'xCls');
|
||||
assert(xCls2.name !== 'xCls2');
|
||||
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
verifyNotEnumerable(cls, 'name');
|
||||
verifyNotWritable(cls, 'name');
|
||||
verifyConfigurable(cls, 'name');
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-init-fn-name-cover-gen.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-init-fn-name-cover.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement)
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -29,15 +29,13 @@ info: |
|
||||
[...] 7. If Initializer is present and value is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
b. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
a. Let hasNameProperty be ? HasOwnProperty(v, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var xCover, cover;
|
||||
let xCover, cover;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ xCover = (0, function() {}), cover = (function() {}) ] of [[]]) {
|
||||
assert(xCover.name !== 'xCover');
|
||||
@ -51,6 +49,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-fn-name-fn.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (FunctionExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [class, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 7. If Initializer is present and value is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(v, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let xFnexp, fnexp;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ xFnexp = function x() {}, fnexp = function() {} ] of [[]]) {
|
||||
assert(xFnexp.name !== 'xFnexp');
|
||||
|
||||
assert.sameValue(fnexp.name, 'fnexp');
|
||||
verifyNotEnumerable(fnexp, 'name');
|
||||
verifyNotWritable(fnexp, 'name');
|
||||
verifyConfigurable(fnexp, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-fn-name-gen.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (GeneratorExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [generators, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 7. If Initializer is present and value is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(v, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let xGen, gen;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ xGen = function* x() {}, gen = function*() {} ] of [[]]) {
|
||||
assert.notSameValue(xGen.name, 'xGen');
|
||||
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
verifyNotEnumerable(gen, 'name');
|
||||
verifyNotWritable(gen, 'name');
|
||||
verifyConfigurable(gen, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-init-in.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-init-in.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The Initializer in an AssignmentElement may be an `in` expression. (for-await-of statement)
|
||||
description: The Initializer in an AssignmentElement may be an `in` expression. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,9 +24,9 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
let x;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x = 'x' in {} ] of [[]]) {
|
||||
assert.sameValue(x, false);
|
||||
@ -35,6 +35,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-let.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Value retrieval of Initializer obeys `let` semantics. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [let, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x = y ] of [[]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(constructor, ReferenceError);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
let y;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-init-order.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-init-order.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Initializer values should be assigned in left-to-right order. (for-await-of statement)
|
||||
description: Initializer values should be assigned in left-to-right order. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,10 +24,10 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var x = 0;
|
||||
var a, b;
|
||||
let x = 0;
|
||||
let a, b;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ a = x += 1, b = x *= 2 ] of [[]]) {
|
||||
assert.sameValue(a, 1);
|
||||
@ -38,6 +38,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-init-simple-no-strict.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-init-simple-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Identifiers that appear as the DestructuringAssignmentTarget in an AssignmentElement should take on the iterated value corresponding to their position in the ArrayAssignmentPattern. (for-await-of statement)
|
||||
description: Identifiers that appear as the DestructuringAssignmentTarget in an AssignmentElement should take on the iterated value corresponding to their position in the ArrayAssignmentPattern. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
@ -24,9 +24,9 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var argument, eval;
|
||||
let argument, eval;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([arguments = 4, eval = 5] of [[]]) {
|
||||
assert.sameValue(arguments, 4);
|
||||
@ -36,6 +36,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-yield-ident-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of an AssignmentElement outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([ x = yield ] of [[]])
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-init-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of an AssignmentElement outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 4;
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x = yield ] of [[]]) {
|
||||
assert.sameValue(x, 4);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,81 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-iter-nrml-close.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: IteratorClose is called when assignment evaluation has not exhausted the iterator (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ AssignmentElementList ]
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[Done]] is false, return ? IteratorClose(iterator, result).
|
||||
5. Return result.
|
||||
|
||||
7.4.6 IteratorClose ( iterator, completion )
|
||||
|
||||
[...]
|
||||
5. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
let nextCount = 0;
|
||||
let returnCount = 0;
|
||||
let thisValue = null;
|
||||
let args = null;
|
||||
let _;
|
||||
let iterable = {};
|
||||
let iterator = {
|
||||
next() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ _ ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral or an ArrayLiteral and if the lexical token sequence matched by LeftHandSideExpression cannot be parsed with no tokens left over using AssignmentPattern as the goal symbol. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([[(x, y)]] of [[[]]])
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the value is `null`, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let _;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[ _ ]] of [[null]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
||||
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-undefined-hole.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the value is a "hole", a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let _;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[ _ ]] of [[ , ]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
||||
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-undefined-own.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the value is `undefined`, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let _;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[ x ]] of [[undefined]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
||||
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-undefined.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and no value is defined, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let _;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[ x ]] of [[]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
||||
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-yield-ident-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of a nested destructuring assignment outside of strict mode, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([[x[yield]]] of [[[]]])
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of a nested destructuring assignment outside of strict mode, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 'prop';
|
||||
let x = {};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[x[yield]]] of [[[22]]]) {
|
||||
assert.sameValue(x.prop, 22);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-array.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([[x]] of [[[1]]]) {
|
||||
assert.sameValue(x, 1);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral or an ArrayLiteral and if the lexical token sequence matched by LeftHandSideExpression cannot be parsed with no tokens left over using AssignmentPattern as the goal symbol. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([{ get x() {} }] of [[{}]])
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal and the value is `null`, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[null]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-undefined-hole.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal and the value is a "hole", a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[ , ]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-undefined-own.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal and the value is `undefined`, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[undefined]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-undefined.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal and no value is defined, a TypeError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, TypeError);
|
||||
}).then($DONE, $DONE);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-yield-ident-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment outside of a generator function body, it behaves as a IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([{ x = yield }] of [[{}]])
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-nested-obj-yield-ident-valid-fn.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement)
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
@ -24,10 +24,10 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 2;
|
||||
var x;
|
||||
let yield = 2;
|
||||
let x;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x = yield }] of [[{}]]) {
|
||||
assert.sameValue(x, 2);
|
||||
@ -37,7 +37,9 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-nested-obj-fn.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-nested-obj.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,9 +24,9 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
let x;
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[{ x: 2 }]]) {
|
||||
assert.sameValue(x, 2);
|
||||
@ -37,6 +37,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,37 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-put-const.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The assignment target should obey `const` semantics. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [const, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
const c = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ c ] of [[1]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-put-let.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The assignment target should obey `let` semantics. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [let, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x ] of [[]]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, ReferenceError);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
let x;
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-put-prop-ref-no-get-fn.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-put-prop-ref-no-get.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (for-await-of statement)
|
||||
description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,7 +24,7 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var x, setValue;
|
||||
let x, setValue;
|
||||
x = {
|
||||
get y() {
|
||||
$ERROR('The property should not be accessed.');
|
||||
@ -34,7 +34,7 @@ x = {
|
||||
}
|
||||
};
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([x.y] of [[23]]) {
|
||||
assert.sameValue(setValue, 23);
|
||||
@ -44,6 +44,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,47 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-put-prop-ref-user-err.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Any error raised as a result of setting the value should be forwarded to the runtime. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = {
|
||||
set y(val) {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([x.y] of [[23]
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, Test262Error);
|
||||
}).then($DONE, $DONE);
|
@ -1,8 +1,8 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-async-iteration/array-elem-put-prop-ref-fn.case
|
||||
// - src/dstr-assignment-async-iteration/async-function/for-await-of-async-func.template
|
||||
// - src/dstr-assignment-for-await/array-elem-put-prop-ref.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (for-await-of statement)
|
||||
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
@ -24,9 +24,9 @@ info: |
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var x = {};
|
||||
let x = {};
|
||||
|
||||
var iterCount = 0;
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([x.y] of [[4]]) {
|
||||
assert.sameValue(x.y, 4);
|
||||
@ -36,6 +36,8 @@ async function fn() {
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-put-unresolvable-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Outside of strict mode, if the the assignment target is an unresolvable reference, a new `var` binding should be created in the environment record. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ unresolvable ] of [[]]) {
|
||||
assert.sameValue(unresolvable, undefined);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-put-unresolvable-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: In strict mode, if the the assignment target is an unresolvable reference, a ReferenceError should be thrown. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ unresolvable ] of [[]
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise.then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
|
||||
assert.sameValue(iterCount, 0);
|
||||
assert.sameValue(constructor, ReferenceError);
|
||||
}).then($DONE, $DONE);
|
@ -0,0 +1,45 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-target-identifier.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: Identifiers that appear as the DestructuringAssignmentTarget in an AssignmentElement should take on the iterated value corresponding to their position in the ArrayAssignmentPattern. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x, y, z;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([x, y, z] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, 2);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-target-simple-strict.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: It is a Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and IsValidSimpleAssignmentTarget(LeftHandSideExpression) is false. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([arguments] of [[]])
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-target-yield-invalid.case
|
||||
// - src/dstr-assignment-for-await/error-async-function-syntax/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of an AssignmentElement and outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, onlyStrict, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
async function fn() {
|
||||
for await ([ x[yield] ] of [[]])
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-target-yield-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of an AssignmentElement outside of a generator function body, it behaves as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 'prop';
|
||||
let x = {};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x[yield] ] of [[33]]) {
|
||||
assert.sameValue(x.prop, 33);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,78 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elem-trlg-iter-elision-iter-nrml-close-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: IteratorClose throws a TypeError when `return` returns a non-Object value (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
6. If Elision is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with
|
||||
iteratorRecord as the argument.
|
||||
b. If status is an abrupt completion, then
|
||||
[...]
|
||||
8. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
7. If completion.[[type]] is throw, return Completion(completion).
|
||||
8. If innerResult.[[type]] is throw, return Completion(innerResult).
|
||||
9. If Type(innerResult.[[value]]) is not Object, throw a TypeError
|
||||
exception.
|
||||
|
||||
---*/
|
||||
let x;
|
||||
let nextCount = 0;
|
||||
let iterator = {
|
||||
next() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
let iterable = {
|
||||
[Symbol.iterator]() {
|
||||
return iterator;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ x , , ] of [iterable]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elision-val-array.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern containing only Elisions requires iterable values (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([,] of [[]
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-elision-val-string.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern containing only Elisions requires iterable values (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([,] of ['string literal'
|
||||
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-empty-val-array.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern without an AssignmentElementList requires iterable values. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([] of [[]
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-empty-val-string.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern without an AssignmentElementList requires iterable values. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([] of ['string literal'
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,46 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-after-element.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An AssignmentRestElement following an AssignmentElement consumes all remaining iterable values. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([x, ...y] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y.length, 2);
|
||||
assert.sameValue(y[0], 2);
|
||||
assert.sameValue(y[1], 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,46 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-after-elision.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An AssignmentRestElement following an elision consumes all remaining iterable values. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([, ...x] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x.length, 2);
|
||||
assert.sameValue(x[0], 2);
|
||||
assert.sameValue(x[1], 3);
|
||||
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,47 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-elision.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: ArrayAssignmentPattern may include elisions at any position preceeding a AssignmentRestElement in a AssignmentElementList. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([, , x, , ...y] of [[1, 2, 3, 4, 5, 6]]) {
|
||||
assert.sameValue(x, 3);
|
||||
assert.sameValue(y.length, 2);
|
||||
assert.sameValue(y[0], 5);
|
||||
assert.sameValue(y[1], 6);
|
||||
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,52 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-iteration.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: In the presense of an AssignmentRestElement, value iteration exhausts the iterable value; (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [generators, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let count = 0;
|
||||
let g = function*() {
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
}
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...x] of [g()]) {
|
||||
assert.sameValue(count, 3);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable emits `null` as the only value, an array with a single `null` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x, y]] of [[null]]) {
|
||||
assert.sameValue(x, null);
|
||||
assert.sameValue(y, undefined);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array-undefined-hole.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable is an array with a "hole", an array with a single `undefined` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[ , ]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array-undefined-own.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable emits `undefined` as the only value, an array with a single `undefined` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[undefined]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array-undefined.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable is emits no values, an empty array should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of a nested destructuring assignment and outside of a generator function body, it should behave as an IdentifierExpression. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 'prop';
|
||||
let x = {};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x[yield]]] of [[86]]) {
|
||||
assert.sameValue(x.prop, 86);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-array.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal and the iterable emits `null` as the only value, an array with a single `null` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x, length;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[null]]) {
|
||||
assert.sameValue(x, null);
|
||||
assert.sameValue(length, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,46 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj-undefined-hole.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable is an array with a "hole", an array with a single `undefined` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
// Use the the top-level lexical scope for 'length' to provide compatibility with browsers
|
||||
// where length and name are properties of WindowProxy
|
||||
let length;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[ , ]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,46 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj-undefined-own.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an array literal and the iterable emits `undefined` as the only value, an array with a single `undefined` element should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
// Use the the top-level lexical scope for 'length' to provide compatibility with browsers
|
||||
// where length and name are properties of WindowProxy
|
||||
let length;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[undefined]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,46 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj-undefined.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an obect literal and the iterable is emits no values, an empty array should be used as the value of the nested DestructuringAssignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
// Use the the top-level lexical scope for 'length' to provide compatibility with browsers
|
||||
// where length and name are properties of WindowProxy
|
||||
let length;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 0);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment and outside of a generator function body, it should behave as an IdentifierExpression. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 2;
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ x = yield }] of [[{}]]) {
|
||||
assert.sameValue(x, 2);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-nested-obj.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...{ 1: x }] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 2);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,52 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-put-prop-ref-no-get.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let setValue;
|
||||
let x = {
|
||||
get y() {
|
||||
$ERROR('The property should not be accessed.');
|
||||
},
|
||||
set y(val) {
|
||||
setValue = val;
|
||||
}
|
||||
};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...x.y] of [[23, 45, 99]]) {
|
||||
assert.sameValue(setValue.length, 3);
|
||||
assert.sameValue(setValue[0], 23);
|
||||
assert.sameValue(setValue[1], 45);
|
||||
assert.sameValue(setValue[2], 99);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-put-prop-ref.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = {};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...x.y] of [[4, 3, 2]]) {
|
||||
assert.sameValue(x.y.length, 3);
|
||||
assert.sameValue(x.y[0], 4);
|
||||
assert.sameValue(x.y[1], 3);
|
||||
assert.sameValue(x.y[2], 2);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,40 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-put-unresolvable-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Outside of strict mode, if the the assignment target is an unresolvable reference, a new `var` binding should be created in the environment record. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([ ...unresolvable ] of [[]]) {
|
||||
assert.sameValue(unresolvable.length, 0);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,47 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/array-rest-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of an AssignmentRestElement and outside of a generator function body, it should behave as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 'prop';
|
||||
let x = {};
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ([...x[yield]] of [[33, 44, 55]]) {
|
||||
assert.sameValue(x.prop.length, 3);
|
||||
assert.sameValue(x.prop[0], 33);
|
||||
assert.sameValue(x.prop[1], 44);
|
||||
assert.sameValue(x.prop[2], 55);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,40 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-empty-bool.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (boolean value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({} of [false]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-empty-num.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (number value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({} of [0
|
||||
]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,40 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-empty-obj.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (object value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({} of [{}]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,40 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-empty-string.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (string value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({} of ['']) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-empty-symbol.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (symbol value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let s = Symbol();
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({} of [s]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-identifier-resolution-first.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (first of many) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
let y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x, y } of [{ x: 3 }]) {
|
||||
assert.sameValue(x, 3);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-identifier-resolution-last.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (last of many) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
let w;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ w, x } of [{ x: 4 }]) {
|
||||
assert.sameValue(x, 4);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-identifier-resolution-lone.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (lone identifier) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x, } of [{ x: 2 }]) {
|
||||
assert.sameValue(x, 2);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-identifier-resolution-middle.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (within many) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
let w, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ w, x, y } of [{ x: 5 }]) {
|
||||
assert.sameValue(x, 5);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-identifier-resolution-trlng.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (lone identifier with trailing comma) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = null;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x } of [{ x: 1 }]) {
|
||||
assert.sameValue(x, 1);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-assignment-missing.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference (no corresponding property defined). (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{}]) {
|
||||
assert.sameValue(x, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-assignment-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference (null property value defined). (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: null }]) {
|
||||
assert.sameValue(x, null);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-assignment-truthy.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference (truthy property value defined). (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: 2 }]) {
|
||||
assert.sameValue(x, 2);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-assignment-undef.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference ("undefined" property value defined). (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: undefined }]) {
|
||||
assert.sameValue(x, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,45 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-evaluation.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let flag1 = false;
|
||||
let flag2 = false;
|
||||
let x, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = flag1 = true, y = flag2 = true } of [{ y: 1 }]) {
|
||||
assert.sameValue(flag1, true);
|
||||
assert.sameValue(flag2, false);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-fn-name-arrow.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ArrowFunction) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentProperty : IdentifierReference Initializeropt
|
||||
[...] 6. If Initializeropt is present and v is undefined, then
|
||||
[...]
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
ii. ReturnIfAbrupt(hasNameProperty).
|
||||
iii. If hasNameProperty is false, perform SetFunctionName(v, P).
|
||||
|
||||
---*/
|
||||
let arrow;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ arrow = () => {} } of [{}]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-fn-name-class.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ClassExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [class, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentProperty : IdentifierReference Initializeropt
|
||||
[...] 6. If Initializeropt is present and v is undefined, then
|
||||
[...]
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
ii. ReturnIfAbrupt(hasNameProperty).
|
||||
iii. If hasNameProperty is false, perform SetFunctionName(v, P).
|
||||
|
||||
---*/
|
||||
let xCls, cls, xCls2;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ xCls = class x {}, cls = class {}, xCls2 = class { static name() {} } } of [{}]) {
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
verifyNotEnumerable(cls, 'name');
|
||||
verifyNotWritable(cls, 'name');
|
||||
verifyConfigurable(cls, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,57 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-fn-name-cover.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentProperty : IdentifierReference Initializeropt
|
||||
[...] 6. If Initializeropt is present and v is undefined, then
|
||||
[...]
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
ii. ReturnIfAbrupt(hasNameProperty).
|
||||
iii. If hasNameProperty is false, perform SetFunctionName(v, P).
|
||||
|
||||
---*/
|
||||
let xCover, cover;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ xCover = (0, function() {}), cover = (function() {}) } of [{}]) {
|
||||
assert.notSameValue(xCover.name, 'xCover');
|
||||
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
verifyNotEnumerable(cover, 'name');
|
||||
verifyNotWritable(cover, 'name');
|
||||
verifyConfigurable(cover, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,57 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-fn-name-fn.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (FunctionExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentProperty : IdentifierReference Initializeropt
|
||||
[...] 6. If Initializeropt is present and v is undefined, then
|
||||
[...]
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
ii. ReturnIfAbrupt(hasNameProperty).
|
||||
iii. If hasNameProperty is false, perform SetFunctionName(v, P).
|
||||
|
||||
---*/
|
||||
let xFnexp, fnexp;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ xFnexp = function x() {}, fnexp = function() {} } of [{}]) {
|
||||
assert.notSameValue(xFnexp.name, 'xFnexp');
|
||||
|
||||
assert.sameValue(fnexp.name, 'fnexp');
|
||||
verifyNotEnumerable(fnexp, 'name');
|
||||
verifyNotWritable(fnexp, 'name');
|
||||
verifyConfigurable(fnexp, 'name');
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-fn-name-gen.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (GeneratorExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [generators, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentProperty : IdentifierReference Initializeropt
|
||||
[...] 6. If Initializeropt is present and v is undefined, then
|
||||
[...]
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
i. Let hasNameProperty be HasOwnProperty(v, "name").
|
||||
ii. ReturnIfAbrupt(hasNameProperty).
|
||||
iii. If hasNameProperty is false, perform SetFunctionName(v, P).
|
||||
|
||||
---*/
|
||||
let xGen, gen;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ xGen = function* x() {}, gen = function*() {} } of [{}]) {
|
||||
assert.notSameValue(xGen.name, 'xGen');
|
||||
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
verifyNotEnumerable(gen, 'name');
|
||||
verifyNotWritable(gen, 'name');
|
||||
verifyConfigurable(gen, 'name');
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-in.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The Initializer in an AssignmentProperty may be an `in` expression. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let prop;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ prop = 'x' in {} } of [{}]) {
|
||||
assert.sameValue(prop, false);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,44 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-order.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Initializer values should be assigned in left-to-right order. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x = 0;
|
||||
let a, b;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ a = x += 1, b = x *= 2 } of [{}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(x, 2);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-simple-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let eval, arguments;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ eval = 3, arguments = 4 } of [{}]) {
|
||||
assert.sameValue(eval, 3);
|
||||
assert.sameValue(arguments, 4);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-init-yield-ident-valid.case
|
||||
// - src/dstr-assignment-for-await/async-function/async-func-decl.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of an AssignmentProperty and outside of a generator function body, it should behave as an IdentifierReference. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let yield = 3;
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x = yield } of [{}]) {
|
||||
assert.sameValue(x, 3);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,45 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-put-unresolvable-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Outside of strict mode, if the the assignment target is an unresolvable reference, a new `var` binding should be created in the environment record. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
{
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ unresolvable } of [{}]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => {
|
||||
assert.sameValue(unresolvable, undefined);
|
||||
assert.sameValue(iterCount, 1, 'iteration occurred as expected');
|
||||
}, $DONE)
|
||||
.then($DONE, $DONE);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-id-simple-no-strict.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, noStrict, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let eval;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ eval } of [{ eval: 1 }]) {
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => {
|
||||
assert.sameValue(eval, 1);
|
||||
assert.sameValue(iterCount, 1, 'iteration occurred as expected');
|
||||
}, $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-assignment-missing.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference (non-existent property) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ y: x = 1 } of [{}]) {
|
||||
assert.sameValue(x, 1);
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-assignment-null.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is not undefined, the Initializer should be evaluated and the result assigned to the target reference (null value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ y: x = 1 } of [{ y: null }]) {
|
||||
assert.sameValue(x, null);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-assignment-truthy.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is not undefined, the Initializer should be evaluated and the result assigned to the target reference (truthy value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ y: x = 1 } of [{ y: 2 }]) {
|
||||
assert.sameValue(x, 2);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,41 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-assignment-undef.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: If the Initializer is present and v is undefined, the Initializer should be evaluated and the result assigned to the target reference (undefined value) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let x;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ y: x = 1 } of [{ y: undefined }]) {
|
||||
assert.sameValue(x, 1);
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,47 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-evaluation.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
let flag1 = false;
|
||||
let flag2 = false;
|
||||
let x, y;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x: x = flag1 = true, y: y = flag2 = true } of [{ y: 1 }]) {
|
||||
assert.sameValue(x, true, 'value of `x`');
|
||||
assert.sameValue(flag1, true, 'value of `flag1`');
|
||||
assert.sameValue(y, 1, 'value of `y`');
|
||||
assert.sameValue(flag2, false, 'value of `flag2`');
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
@ -0,0 +1,53 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-fn-name-arrow.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ArrowFunction) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 6. If Initializer is present and v is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(rhsValue, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(rhsValue, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let arrow;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x: arrow = () => {} } of [{}]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-fn-name-class.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ClassExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [class, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 6. If Initializer is present and v is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(rhsValue, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(rhsValue, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let xCls, cls, xCls2;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x: xCls = class x {}, x: cls = class {}, x: xCls2 = class { static name() {} } } of [{}]) {
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
verifyNotEnumerable(cls, 'name');
|
||||
verifyNotWritable(cls, 'name');
|
||||
verifyConfigurable(cls, 'name');
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment-for-await/obj-prop-elem-init-fn-name-cover.case
|
||||
// - src/dstr-assignment-for-await/default/async-func-decl.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement in an async function declaration)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
5. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
|
||||
AssignmentElement[Yield] : DestructuringAssignmentTarget Initializeropt
|
||||
[...] 6. If Initializer is present and v is undefined and
|
||||
IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of
|
||||
DestructuringAssignmentTarget are both true, then
|
||||
a. Let hasNameProperty be ? HasOwnProperty(rhsValue, "name").
|
||||
b. If hasNameProperty is false, perform SetFunctionName(rhsValue, GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
let xCover, cover;
|
||||
|
||||
let iterCount = 0;
|
||||
async function fn() {
|
||||
for await ({ x: xCover = (0, function() {}), x: cover = (function() {}) } of [{}]) {
|
||||
assert.notSameValue(xCover.name, 'xCover');
|
||||
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
verifyNotEnumerable(cover, 'name');
|
||||
verifyNotWritable(cover, 'name');
|
||||
verifyConfigurable(cover, 'name');
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
let promise = fn();
|
||||
|
||||
promise
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user