mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #1061 from rwaldron/dstr-assignment-invalid-removal
Remove src/dstr-assignment/default/for-await-of.template (invalid)
This commit is contained in:
commit
b2bb2f9e5a
src/dstr-assignment/default
test/language/statements/for-await-of
dstr-array-elem-init-assignment.jsdstr-array-elem-init-evaluation.jsdstr-array-elem-init-fn-name-arrow.jsdstr-array-elem-init-fn-name-class.jsdstr-array-elem-init-fn-name-cover.jsdstr-array-elem-init-fn-name-fn.jsdstr-array-elem-init-fn-name-gen.jsdstr-array-elem-init-in.jsdstr-array-elem-init-order.jsdstr-array-elem-init-simple-no-strict.jsdstr-array-elem-init-yield-expr.jsdstr-array-elem-init-yield-ident-valid.jsdstr-array-elem-iter-nrml-close-skip.jsdstr-array-elem-iter-nrml-close.jsdstr-array-elem-iter-rtrn-close-err.jsdstr-array-elem-iter-rtrn-close-null.jsdstr-array-elem-iter-rtrn-close.jsdstr-array-elem-nested-array-yield-expr.jsdstr-array-elem-nested-array-yield-ident-valid.jsdstr-array-elem-nested-array.jsdstr-array-elem-nested-obj-yield-expr.jsdstr-array-elem-nested-obj-yield-ident-valid.jsdstr-array-elem-nested-obj.jsdstr-array-elem-put-prop-ref-no-get.jsdstr-array-elem-put-prop-ref.jsdstr-array-elem-put-unresolvable-no-strict.jsdstr-array-elem-target-identifier.jsdstr-array-elem-target-simple-no-strict.jsdstr-array-elem-target-yield-expr.jsdstr-array-elem-target-yield-valid.jsdstr-array-elem-trlg-iter-elision-iter-nrml-close-skip.jsdstr-array-elem-trlg-iter-elision-iter-nrml-close.jsdstr-array-elem-trlg-iter-list-nrml-close-skip.jsdstr-array-elem-trlg-iter-list-nrml-close.jsdstr-array-elem-trlg-iter-list-rtrn-close-err.jsdstr-array-elem-trlg-iter-list-rtrn-close-null.jsdstr-array-elem-trlg-iter-list-rtrn-close.jsdstr-array-elem-trlg-iter-rest-nrml-close-skip.jsdstr-array-elem-trlg-iter-rest-rtrn-close-err.jsdstr-array-elem-trlg-iter-rest-rtrn-close-null.jsdstr-array-elem-trlg-iter-rest-rtrn-close.jsdstr-array-elision-iter-nrml-close-skip.jsdstr-array-elision-iter-nrml-close.jsdstr-array-elision-val-array.jsdstr-array-elision-val-string.jsdstr-array-empty-iter-close.jsdstr-array-empty-val-array.jsdstr-array-empty-val-string.jsdstr-array-iteration.jsdstr-array-rest-after-element.jsdstr-array-rest-after-elision.jsdstr-array-rest-elision.jsdstr-array-rest-iter-nrml-close-skip.jsdstr-array-rest-iter-rtrn-close-err.jsdstr-array-rest-iter-rtrn-close-null.jsdstr-array-rest-iter-rtrn-close.jsdstr-array-rest-iteration.jsdstr-array-rest-lref.jsdstr-array-rest-nested-array-null.jsdstr-array-rest-nested-array-undefined-hole.jsdstr-array-rest-nested-array-undefined-own.jsdstr-array-rest-nested-array-undefined.jsdstr-array-rest-nested-array-yield-expr.jsdstr-array-rest-nested-array-yield-ident-valid.jsdstr-array-rest-nested-array.jsdstr-array-rest-nested-obj-null.jsdstr-array-rest-nested-obj-undefined-hole.jsdstr-array-rest-nested-obj-undefined-own.jsdstr-array-rest-nested-obj-undefined.jsdstr-array-rest-nested-obj-yield-expr.jsdstr-array-rest-nested-obj-yield-ident-valid.jsdstr-array-rest-nested-obj.jsdstr-array-rest-put-prop-ref-no-get.jsdstr-array-rest-put-prop-ref.jsdstr-array-rest-put-unresolvable-no-strict.jsdstr-array-rest-yield-expr.jsdstr-array-rest-yield-ident-valid.jsdstr-obj-empty-bool.jsdstr-obj-empty-num.jsdstr-obj-empty-obj.jsdstr-obj-empty-string.jsdstr-obj-empty-symbol.jsdstr-obj-id-identifier-resolution-first.jsdstr-obj-id-identifier-resolution-last.jsdstr-obj-id-identifier-resolution-lone.jsdstr-obj-id-identifier-resolution-middle.jsdstr-obj-id-identifier-resolution-trlng.jsdstr-obj-id-identifier-yield-ident-valid.jsdstr-obj-id-init-assignment-missing.jsdstr-obj-id-init-assignment-null.jsdstr-obj-id-init-assignment-truthy.jsdstr-obj-id-init-assignment-undef.jsdstr-obj-id-init-evaluation.jsdstr-obj-id-init-fn-name-arrow.jsdstr-obj-id-init-fn-name-class.jsdstr-obj-id-init-fn-name-cover.jsdstr-obj-id-init-fn-name-fn.jsdstr-obj-id-init-fn-name-gen.jsdstr-obj-id-init-in.js
@ -1,39 +0,0 @@
|
||||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/for-await-of/dstr-
|
||||
name: for-await-of statement
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (/*{ elems }*/ of [/*{ vals }*/]) {
|
||||
/*{ body }*/
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-assignment.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var v2, vNull, vHole, vUndefined, vOob;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,42 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-evaluation.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var flag1 = false, flag2 = false;
|
||||
var _;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ _ = flag1 = true, _ = flag2 = true ] of [[14]]) {
|
||||
assert.sameValue(flag1, false);
|
||||
assert.sameValue(flag2, true);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,54 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-fn-name-arrow.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ArrowFunction) (for-await-of statement)
|
||||
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. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var arrow;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ arrow = () => {} ] of [[]]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,57 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-fn-name-class.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ClassExpression) (for-await-of statement)
|
||||
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. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var xCls, cls, xCls2;
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-fn-name-cover.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement)
|
||||
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. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var xCover, cover;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ xCover = (0, function() {}), cover = (function() {}) ] of [[]]) {
|
||||
assert(xCover.name !== 'xCover');
|
||||
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
verifyNotEnumerable(cover, 'name');
|
||||
verifyNotWritable(cover, 'name');
|
||||
verifyConfigurable(cover, 'name');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-fn-name-fn.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (FunctionExpression) (for-await-of statement)
|
||||
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. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var xFn, fn;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ xFn = function x() {}, fn = function() {} ] of [[]]) {
|
||||
assert(xFn.name !== 'xFn');
|
||||
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
verifyNotEnumerable(fn, 'name');
|
||||
verifyNotWritable(fn, 'name');
|
||||
verifyConfigurable(fn, 'name');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-fn-name-gen.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (GeneratorExpression) (for-await-of statement)
|
||||
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. ReturnIfAbrupt(hasNameProperty).
|
||||
c. If hasNameProperty is false, perform SetFunctionName(v,
|
||||
GetReferencedName(lref)).
|
||||
|
||||
---*/
|
||||
var xGen, gen;
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-in.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The Initializer in an AssignmentElement may be an `in` expression. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x = 'x' in {} ] of [[]]) {
|
||||
assert.sameValue(x, false);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,43 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-order.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Initializer values should be assigned in left-to-right order. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = 0;
|
||||
var a, b;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-simple-no-strict.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var argument, eval;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([arguments = 4, eval = 5] of [[]]) {
|
||||
assert.sameValue(arguments, 4);
|
||||
assert.sameValue(eval, 5);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of an AssignmentElement within a generator function body, it behaves as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var value = [];
|
||||
var iterationResult, iter, x;
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x = yield ] of [[]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
})();
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
iterationResult = iter.next(86);
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x, 86);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-init-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 4;
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x = yield ] of [[]]) {
|
||||
assert.sameValue(x, 4);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,64 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-iter-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is not called when assignment evaluation has exhausted the iterator (for-await-of statement)
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator, result).
|
||||
6. Return result.
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var _;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ _ ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,80 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-iter-nrml-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when assignment evaluation has not exhausted the iterator (for-await-of statement)
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
6. Return result.
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var _;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,79 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-iter-rtrn-close-err.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when reference evaluation produces a "return" completion (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ AssignmentElementList ]
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
6. Return result.
|
||||
|
||||
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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[ yield ] ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
iter = g();
|
||||
iter.next();
|
||||
assert.throws(Test262Error, function() {
|
||||
iter.return();
|
||||
});
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
@ -1,76 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-iter-rtrn-close-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose throws a TypeError when `return` returns a non-Object value (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ AssignmentElementList ]
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
6. Return result.
|
||||
|
||||
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.
|
||||
|
||||
---*/
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[yield] ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
iter.return();
|
||||
});
|
@ -1,86 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-iter-rtrn-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when reference evaluation produces a "return" completion (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ AssignmentElementList ]
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
6. Return result.
|
||||
|
||||
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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
var iter, result;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[yield] ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
iter = g();
|
||||
iter.next();
|
||||
result = iter.return(777);
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
||||
assert.sameValue(result.value, 777);
|
||||
assert(result.done, 'Iterator correctly closed');
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
@ -1,58 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-array-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of a nested destructuring assignment and within a generator function body, it behaves as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var value = [[22]];
|
||||
var x = {};
|
||||
var iterationResult, iter;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([[x[yield]]] of [value]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x.prop, undefined);
|
||||
|
||||
iterationResult = iter.next('prop');
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x.prop, 22);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-array-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 'prop';
|
||||
var x = {};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([[x[yield]]] of [[[22]]]) {
|
||||
assert.sameValue(x.prop, 22);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-array.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([[x]] of [[[1]]]) {
|
||||
assert.sameValue(x, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-obj-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment and within a generator function body, it behaves as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var iterationResult, iter, x;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([{ x = yield }] of [[{}]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
iterationResult = iter.next(4);
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x, 4);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-obj-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 2;
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([{ x = yield }] of [[{}]]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-nested-obj.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([{ x }] of [[{ x: 2 }]]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,48 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-put-prop-ref-no-get.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x, setValue;
|
||||
x = {
|
||||
get y() {
|
||||
$ERROR('The property should not be accessed.');
|
||||
},
|
||||
set y(val) {
|
||||
setValue = val;
|
||||
}
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([x.y] of [[23]]) {
|
||||
assert.sameValue(setValue, 23);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-put-prop-ref.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = {};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([x.y] of [[4]]) {
|
||||
assert.sameValue(x.y, 4);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-put-unresolvable-no-strict.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ unresolvable ] of [[]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
assert.sameValue(unresolvable, undefined);
|
@ -1,42 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-target-identifier.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x, y, z;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-target-simple-no-strict.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var argument, eval;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([arguments, eval] of [[2, 3]]) {
|
||||
assert.sameValue(arguments, 2);
|
||||
assert.sameValue(eval, 3);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,58 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-target-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of an AssignmentElement within a generator function body, it behaves as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var value = [33];
|
||||
var x = {};
|
||||
var iterationResult, iter;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x[yield] ] of [[33]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x.prop, undefined);
|
||||
|
||||
iterationResult = iter.next('prop');
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x.prop, 33);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-target-yield-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 'prop';
|
||||
var x = {};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x[yield] ] of [[33]]) {
|
||||
assert.sameValue(x.prop, 33);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,72 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-elision-iter-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose not invoked when elision exhausts the iterator (for-await-of statement)
|
||||
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).
|
||||
9. Return Completion(status).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var iterable = {};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
|
||||
return { done: nextCount > 1 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , , ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 2);
|
||||
assert.sameValue(returnCount, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,87 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-elision-iter-nrml-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose invoked when elision does not exhaust the iterator (for-await-of statement)
|
||||
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, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , , ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 2);
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-list-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is not invoked when evaluation of AssignmentElementList exhausts the iterator (for-await-of statement)
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}.
|
||||
4. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentElementList using
|
||||
iteratorRecord as the argument.
|
||||
5. If status is an abrupt completion, then
|
||||
a. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
b. Return Completion(status).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var iterable = {};
|
||||
var thrower = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,86 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-list-nrml-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is invoked when evaluation of AssignmentElementList completes without exhausting the iterator (for-await-of statement)
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}.
|
||||
4. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentElementList using
|
||||
iteratorRecord as the argument.
|
||||
5. If status is an abrupt completion, then
|
||||
a. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
b. Return Completion(status).
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ] 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,86 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-list-rtrn-close-err.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is invoked when evaluation of AssignmentElementList returns a "return" completion and the iterator has not been marked as "done" (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}.
|
||||
4. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentElementList using
|
||||
iteratorRecord as the argument.
|
||||
5. If status is an abrupt completion, then
|
||||
a. 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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[yield] , ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
assert.throws(Test262Error, function() {
|
||||
iter.return();
|
||||
});
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
@ -1,83 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-list-rtrn-close-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose throws a TypeError when `return` returns a non-Object value (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}.
|
||||
4. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentElementList using
|
||||
iteratorRecord as the argument.
|
||||
5. If status is an abrupt completion, then
|
||||
a. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
b. Return Completion(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.
|
||||
|
||||
---*/
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[yield] , ] of [iterable]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
iter.return();
|
||||
});
|
@ -1,94 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-list-rtrn-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is invoked when evaluation of AssignmentElementList returns a "return" completion and the iterator has not been marked as "done" (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}.
|
||||
4. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentElementList using
|
||||
iteratorRecord as the argument.
|
||||
5. If status is an abrupt completion, then
|
||||
a. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
b. Return Completion(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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
var iter, result;
|
||||
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ {}[yield] , ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
};
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
result = iter.return(888);
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
||||
assert.sameValue(result.value, 888);
|
||||
assert(result.done, 'Iterator correctly closed');
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
@ -1,73 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-rest-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is not called when rest element evaluation has exhausted the iterator (for-await-of statement)
|
||||
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 ]
|
||||
|
||||
[...]
|
||||
7. If AssignmentRestElement is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement
|
||||
with iteratorRecord as the argument.
|
||||
8. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
9. Return Completion(status).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var iterable = {};
|
||||
var x, y;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { value: nextCount, done: nextCount > 1 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ...y ] of [iterable]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(nextCount, 2, 'nextCount');
|
||||
assert.sameValue(returnCount, 0, 'returnCount');
|
||||
assert.sameValue(x, 1, 'x');
|
||||
assert.sameValue(y.length, 0, 'y.length');
|
@ -1,95 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-rest-rtrn-close-err.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when AssignmentRestEvaluation produces a "return" completion due to reference evaluation (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
7. If AssignmentRestElement is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement
|
||||
with iteratorRecord as the argument.
|
||||
8. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
9. Return Completion(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).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var x;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ...{}[yield] ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
iter.return();
|
||||
});
|
||||
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
@ -1,90 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-rest-rtrn-close-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose throws a TypeError when `return` returns a non-Object value (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
7. If AssignmentRestElement is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement
|
||||
with iteratorRecord as the argument.
|
||||
8. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
9. Return Completion(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).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var iterable = {};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ...{}[yield] ] of [iterable]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
iter.return();
|
||||
});
|
||||
|
||||
assert.sameValue(nextCount, 1);
|
@ -1,101 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elem-trlg-iter-rest-rtrn-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when AssignmentRestEvaluation produces a "return" completion due to reference evaluation (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern :
|
||||
[ AssignmentElementList , Elisionopt AssignmentRestElementopt ]
|
||||
|
||||
[...]
|
||||
7. If AssignmentRestElement is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement
|
||||
with iteratorRecord as the argument.
|
||||
8. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
status).
|
||||
9. Return Completion(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).
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var x;
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
var iter, result;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ x , ...{}[yield] ] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
result = iter.return(999);
|
||||
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
||||
assert.sameValue(result.value, 999);
|
||||
assert(result.done, 'Iterator correctly closed');
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
@ -1,65 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elision-iter-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is not called when iteration has exhausted the iterator (for-await-of statement)
|
||||
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 : [ Elision ]
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ , ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,80 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elision-iter-nrml-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when assignment evaluation has not exhausted the iterator (for-await-of statement)
|
||||
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 : [ Elision ]
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
// Set an upper-bound to limit unnecessary iteration in non-conformant
|
||||
// implementations
|
||||
return { done: nextCount > 10 };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elision-val-array.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern containing only Elisions requires iterable values (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([,] of [[]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-elision-val-string.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern containing only Elisions requires iterable values (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([,] of ['string literal']) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,76 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-empty-iter-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Iterator is closed without iterating (for-await-of statement)
|
||||
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 : [ ]
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
3. Return IteratorClose(iterator, NormalCompletion(empty)).
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([] of [iterable]) {
|
||||
assert.sameValue(nextCount, 0);
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-empty-val-array.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern without an AssignmentElementList requires iterable values. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([] of [[]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-empty-val-string.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ArrayAssignmentPattern without an AssignmentElementList requires iterable values. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([] of ['string literal']) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,47 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-iteration.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Value iteration only proceeds for the number of elements in the ArrayAssignmentPattern. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var count = 0;
|
||||
var g = function*() {
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
}
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([,,] of [g()]) {
|
||||
assert.sameValue(count, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,43 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-after-element.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An AssignmentRestElement following an AssignmentElement consumes all remaining iterable values. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x, y;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,42 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-after-elision.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An AssignmentRestElement following an elision consumes all remaining iterable values. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,43 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-elision.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: ArrayAssignmentPattern may include elisions at any position preceeding a AssignmentRestElement in a AssignmentElementList. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x, y;
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,67 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-iter-nrml-close-skip.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is not called when assignment evaluation has exhausted the iterator (for-await-of statement)
|
||||
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 : [ Elisionopt AssignmentRestElement ]
|
||||
|
||||
[...]
|
||||
5. Let result be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement with
|
||||
iteratorRecord as the argument
|
||||
6. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
7. Return result.
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var x;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
}
|
||||
};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ ...x ] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,91 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-iter-rtrn-close-err.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when reference evaluation produces a "return" completion (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]
|
||||
|
||||
[...]
|
||||
5. Let result be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement with
|
||||
iteratorRecord as the argument
|
||||
6. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
|
||||
AssignmentRestElement[Yield] : ... DestructuringAssignmentTarget
|
||||
|
||||
1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an
|
||||
ArrayLiteral, then
|
||||
a. Let lref be the result of evaluating DestructuringAssignmentTarget.
|
||||
b. ReturnIfAbrupt(lref).
|
||||
|
||||
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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
function ReturnError() {}
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{}[yield]] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
assert.throws(Test262Error, function() {
|
||||
iter.return();
|
||||
});
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
@ -1,90 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-iter-rtrn-close-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose throws a TypeError when `return` returns a non-Object value (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]
|
||||
|
||||
[...]
|
||||
5. Let result be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement with
|
||||
iteratorRecord as the argument
|
||||
6. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
|
||||
AssignmentRestElement[Yield] : ... DestructuringAssignmentTarget
|
||||
|
||||
1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an
|
||||
ArrayLiteral, then
|
||||
a. Let lref be the result of evaluating DestructuringAssignmentTarget.
|
||||
b. ReturnIfAbrupt(lref).
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
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).
|
||||
|
||||
---*/
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
var iter;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{}[yield]] of [iterable]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
iter.return();
|
||||
});
|
@ -1,102 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-iter-rtrn-close.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: IteratorClose is called when reference evaluation produces a "return" completion (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [Symbol.iterator, 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.
|
||||
[...]
|
||||
|
||||
ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]
|
||||
|
||||
[...]
|
||||
5. Let result be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement with
|
||||
iteratorRecord as the argument
|
||||
6. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
|
||||
AssignmentRestElement[Yield] : ... DestructuringAssignmentTarget
|
||||
|
||||
1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an
|
||||
ArrayLiteral, then
|
||||
a. Let lref be the result of evaluating DestructuringAssignmentTarget.
|
||||
b. ReturnIfAbrupt(lref).
|
||||
|
||||
7.4.6 IteratorClose( iterator, completion )
|
||||
|
||||
[...]
|
||||
6. Let innerResult be Call(return, iterator, « »).
|
||||
[...]
|
||||
|
||||
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).
|
||||
|
||||
---*/
|
||||
var returnCount = 0;
|
||||
var unreachable = 0;
|
||||
var thisValue = null;
|
||||
var args = null;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
thisValue = this;
|
||||
args = arguments;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
var iter, result;
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
function* g() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{}[yield]] of [iterable]) {
|
||||
unreachable += 1;
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
iter = g();
|
||||
iter.next();
|
||||
result = iter.return(444);
|
||||
|
||||
assert.sameValue(returnCount, 1);
|
||||
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
|
||||
assert.sameValue(result.value, 444);
|
||||
assert(result.done, 'Iterator correctly closed');
|
||||
assert.sameValue(thisValue, iterator, 'correct `this` value');
|
||||
assert(!!args, 'arguments object provided');
|
||||
assert.sameValue(args.length, 0, 'zero arguments specified');
|
@ -1,48 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-iteration.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: In the presense of an AssignmentRestElement, value iteration exhausts the iterable value; (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var count = 0;
|
||||
var g = function*() {
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
yield;
|
||||
count += 1;
|
||||
}
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...x] of [g()]) {
|
||||
assert.sameValue(count, 3);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,76 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-lref.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Reference is evaluated during assignment (for-await-of statement)
|
||||
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 : [ Elisionopt AssignmentRestElement ]
|
||||
|
||||
[...]
|
||||
5. Let result be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of AssignmentRestElement with
|
||||
iteratorRecord as the argument
|
||||
6. If iteratorRecord.[[done]] is false, return IteratorClose(iterator,
|
||||
result).
|
||||
|
||||
AssignmentRestElement[Yield] : ... DestructuringAssignmentTarget
|
||||
|
||||
1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an
|
||||
ArrayLiteral, then
|
||||
a. Let lref be the result of evaluating DestructuringAssignmentTarget.
|
||||
b. ReturnIfAbrupt(lref).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var nextCount = 0;
|
||||
var returnCount = 0;
|
||||
var iterable = {};
|
||||
var iterator = {
|
||||
next: function() {
|
||||
nextCount += 1;
|
||||
return { done: true };
|
||||
},
|
||||
return: function() {
|
||||
returnCount += 1;
|
||||
}
|
||||
};
|
||||
var obj = {};
|
||||
iterable[Symbol.iterator] = function() {
|
||||
return iterator;
|
||||
};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...obj['a' + 'b']] of [iterable]) {
|
||||
assert.sameValue(nextCount, 1);
|
||||
assert.sameValue(returnCount, 0);
|
||||
assert(!!obj.ab);
|
||||
assert.sameValue(obj.ab.length, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x, y;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x, y]] of [[null]]) {
|
||||
assert.sameValue(x, null);
|
||||
assert.sameValue(y, undefined);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-undefined-hole.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[ , ]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-undefined-own.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[undefined]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-undefined.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,58 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of a nested destructuring assignment and within a generator function body, it should behave as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var value = [86];
|
||||
var x = {};
|
||||
var iterationResult, iter;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x[yield]]] of [[86]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x.prop, undefined);
|
||||
|
||||
iterationResult = iter.next('prop');
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x.prop, 86);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 'prop';
|
||||
var x = {};
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x[yield]]] of [[86]]) {
|
||||
assert.sameValue(x.prop, 86);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-array.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...[x]] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x, length;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[null]]) {
|
||||
assert.sameValue(x, null);
|
||||
assert.sameValue(length, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-undefined-hole.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var 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;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[ , ]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-undefined-own.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var 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;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[undefined]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-undefined.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var 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;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ 0: x, length }] of [[]]) {
|
||||
assert.sameValue(x, undefined);
|
||||
assert.sameValue(length, 0);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the Initializer of a nested destructuring assignment and within a generator function body, it should behave as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var iterationResult, iter, x;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ x = yield }] of [[{}]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x, undefined);
|
||||
|
||||
iterationResult = iter.next(4);
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x, 4);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 2;
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ x = yield }] of [[{}]]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-nested-obj.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...{ 1: x }] of [[1, 2, 3]]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,51 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-put-prop-ref-no-get.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: If the DestructuringAssignmentTarget of an AssignmentElement is a PropertyReference, it should not be evaluated. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var setValue;
|
||||
var x = {
|
||||
get y() {
|
||||
$ERROR('The property should not be accessed.');
|
||||
},
|
||||
set y(val) {
|
||||
setValue = val;
|
||||
}
|
||||
};
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,43 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-put-prop-ref.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The DestructuringAssignmentTarget of an AssignmentElement may be a PropertyReference. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = {};
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-put-unresolvable-no-strict.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
{
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([ ...unresolvable ] of [[]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}
|
||||
|
||||
assert.sameValue(unresolvable.length, 0);
|
@ -1,60 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-yield-expr.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: When a `yield` token appears within the DestructuringAssignmentTarget of an AssignmentRestElement and within the body of a generator function, it should behave as a YieldExpression. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x = {};
|
||||
var iterationResult, iter;
|
||||
|
||||
iter = (function*() {
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ([...x[yield]] of [[33, 44, 55]]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
||||
}());
|
||||
|
||||
iterationResult = iter.next();
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, false);
|
||||
assert.sameValue(x.prop, undefined);
|
||||
|
||||
iterationResult = iter.next('prop');
|
||||
|
||||
assert.sameValue(iterationResult.value, undefined);
|
||||
assert.sameValue(iterationResult.done, true);
|
||||
assert.sameValue(x.prop.length, 3);
|
||||
assert.sameValue(x.prop[0], 33);
|
||||
assert.sameValue(x.prop[1], 44);
|
||||
assert.sameValue(x.prop[2], 55);
|
@ -1,44 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/array-rest-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield = 'prop';
|
||||
var x = {};
|
||||
|
||||
var counter = 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);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-empty-bool.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (boolean value) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({} of [false]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-empty-num.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (number value) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({} of [0]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-empty-obj.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (object value) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({} of [{}]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,39 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-empty-string.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (string value) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({} of ['']) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-empty-symbol.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: An ObjectAssignmentPattern without an AssignmentPropertyList requires an object-coercible value (symbol value) (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var s = Symbol();
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({} of [s]) {
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-resolution-first.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (first of many) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
var y;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x, y } of [{ x: 3 }]) {
|
||||
assert.sameValue(x, 3);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-resolution-last.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (last of many) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
var w;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ w, x } of [{ x: 4 }]) {
|
||||
assert.sameValue(x, 4);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-resolution-lone.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (lone identifier) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x, } of [{ x: 2 }]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,41 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-resolution-middle.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (within many) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
var w, y;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ w, x, y } of [{ x: 5 }]) {
|
||||
assert.sameValue(x, 5);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-resolution-trlng.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Evaluation of DestructuringAssignmentTarget (lone identifier with trailing comma) (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var x = null;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x } of [{ x: 1 }]) {
|
||||
assert.sameValue(x, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-identifier-yield-ident-valid.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: yield is a valid IdentifierReference in an AssignmentProperty outside of strict mode and generator functions. (for-await-of statement)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var yield;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ yield } of [{ yield: 3 }]) {
|
||||
assert.sameValue(yield, 3);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-assignment-missing.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{}]) {
|
||||
assert.sameValue(x, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-assignment-null.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: null }]) {
|
||||
assert.sameValue(x, null);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-assignment-truthy.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: 2 }]) {
|
||||
assert.sameValue(x, 2);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-assignment-undef.case
|
||||
// - src/dstr-assignment/default/for-await-of.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)
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
var x;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x = 1 } of [{ x: undefined }]) {
|
||||
assert.sameValue(x, 1);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,43 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-evaluation.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The Initializer should only be evaluated if v is undefined. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var flag1 = false;
|
||||
var flag2 = false;
|
||||
var x, y;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ x = flag1 = true, y = flag2 = true } of [{ y: 1 }]) {
|
||||
assert.sameValue(flag1, true);
|
||||
assert.sameValue(flag2, false);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,53 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-fn-name-arrow.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ArrowFunction) (for-await-of statement)
|
||||
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).
|
||||
|
||||
---*/
|
||||
var arrow;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ arrow = () => {} } of [{}]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
verifyNotEnumerable(arrow, 'name');
|
||||
verifyNotWritable(arrow, 'name');
|
||||
verifyConfigurable(arrow, 'name');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,56 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-fn-name-class.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (ClassExpression) (for-await-of statement)
|
||||
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).
|
||||
|
||||
---*/
|
||||
var xCls, cls, xCls2;
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,55 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-fn-name-cover.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (CoverParenthesizedExpression) (for-await-of statement)
|
||||
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).
|
||||
|
||||
---*/
|
||||
var xCover, cover;
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,55 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-fn-name-fn.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (FunctionExpression) (for-await-of statement)
|
||||
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).
|
||||
|
||||
---*/
|
||||
var xFn, fn;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ xFn = function x() {}, fn = function() {} } of [{}]) {
|
||||
assert.notSameValue(xFn.name, 'xFn');
|
||||
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
verifyNotEnumerable(fn, 'name');
|
||||
verifyNotWritable(fn, 'name');
|
||||
verifyConfigurable(fn, 'name');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,55 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-fn-name-gen.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: Assignment of function `name` attribute (GeneratorExpression) (for-await-of statement)
|
||||
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).
|
||||
|
||||
---*/
|
||||
var xGen, gen;
|
||||
|
||||
var counter = 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');
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
@ -1,40 +0,0 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-id-init-in.case
|
||||
// - src/dstr-assignment/default/for-await-of.template
|
||||
/*---
|
||||
description: The Initializer in an AssignmentProperty may be an `in` expression. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( 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.
|
||||
[...]
|
||||
---*/
|
||||
var prop;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
async function fn() {
|
||||
for await ({ prop = 'x' in {} } of [{}]) {
|
||||
assert.sameValue(prop, false);
|
||||
counter += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(counter, 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