mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
6d3f8152fc
commit
285888ada1
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-close.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Iterator is closed when not exhausted by pattern evaluation (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var doneCallCount = 0;
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return { value: null, done: false };
|
||||
},
|
||||
return: function() {
|
||||
doneCallCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
assert.sameValue(doneCallCount, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(iter).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-no-close.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Iterator is not closed when exhausted by pattern evaluation (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var doneCallCount = 0;
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return { value: null, done: true };
|
||||
},
|
||||
return: function() {
|
||||
doneCallCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
assert.sameValue(doneCallCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(iter).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-name-iter-val.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding with normal value iteration (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x, y, z]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, 2);
|
||||
assert.sameValue(z, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[x, y, z] = [4, 5, 6]]) {
|
||||
assert.sameValue(x, 4);
|
||||
assert.sameValue(y, 5);
|
||||
assert.sameValue(z, 6);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[x, y, z] = [4, 5, 6]]) {
|
||||
assert.sameValue(x, 7);
|
||||
assert.sameValue(y, 8);
|
||||
assert.sameValue(z, 9);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([[7, 8, 9]]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[,] = g()]) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
---*/
|
||||
var callCount = 0;
|
||||
function* g() {
|
||||
callCount += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[,] = g()]) {
|
||||
assert.sameValue(callCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([[]]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var initCount = 0;
|
||||
var iterCount = 0;
|
||||
var iter = function*() { iterCount += 1; }();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[] = function() { initCount += 1; return iter; }()]) {
|
||||
assert.sameValue(initCount, 1);
|
||||
assert.sameValue(iterCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var initCount = 0;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[] = function() { initCount += 1; }()]) {
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([[23]]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var values = [2, 1, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[...x] = values]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x[0], 2);
|
||||
assert.sameValue(x[1], 1);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var values = [2, 1, 3];
|
||||
var initCount = 0;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[...x] = function() { initCount += 1; }()]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x[0], 2);
|
||||
assert.sameValue(x[1], 1);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.notSameValue(x, values);
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([values]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer with an exhausted iterator (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23]) {
|
||||
assert.sameValue(x, 23);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding does assign name to arrow functions (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([arrow = () => {}]) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns `name` to "anonymous" classes (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([cover = (function () {}), xCover = (0, function() {})]) {
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
assert.notSameValue(xCover.name, 'xCover');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" functions (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([fn = function () {}, xFn = function x() {}]) {
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
assert.notSameValue(xFn.name, 'xFn');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" generator functions (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([gen = function* () {}, xGen = function* x() {}]) {
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
assert.notSameValue(xGen.name, 'xGen');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer with a "hole" (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
[...] 6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23]) {
|
||||
assert.sameValue(x, 23);
|
||||
// another statement
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([,]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is not evaluated when value is not `undefined` (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function counter() {
|
||||
initCount += 1;
|
||||
}
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([w = counter(), x = counter(), y = counter(), z = counter()]) {
|
||||
assert.sameValue(w, null);
|
||||
assert.sameValue(x, 0);
|
||||
assert.sameValue(y, false);
|
||||
assert.sameValue(z, '');
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([null, 0, false, '']).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer with an undefined value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23]) {
|
||||
assert.sameValue(x, 23);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([undefined]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration completes (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
assert.sameValue(x, undefined);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration was completed previously (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([_, x]) {
|
||||
assert.sameValue(x, undefined);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration was completed previously (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x, y, z]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, 2);
|
||||
assert.sameValue(z, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
|
||||
assert.sameValue(x, 44);
|
||||
assert.sameValue(y, 55);
|
||||
assert.sameValue(z, 66);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
|
||||
assert.sameValue(x, 11);
|
||||
assert.sameValue(y, 22);
|
||||
assert.sameValue(z, 33);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([{ x: 11, y: 22, z: 33 }]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
|
||||
assert.sameValue(v, 444);
|
||||
assert.sameValue(x, 555);
|
||||
assert.sameValue(z, 666);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
u;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
w;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
y;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is not used (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
|
||||
assert.sameValue(v, 777);
|
||||
assert.sameValue(x, 888);
|
||||
assert.sameValue(z, 999);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
u;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
w;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
y;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([{ u: 777, w: 888, y: 999 }]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Elision accepts exhausted iterator (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iter = function*() {}();
|
||||
iter.next();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([,]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(iter).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,58 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Elision advances iterator (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([,]) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(g()).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-empty.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: No iteration occurs for an "empty" array binding pattern (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ ]
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iterations = 0;
|
||||
var iter = function*() {
|
||||
iterations += 1;
|
||||
}();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([]) {
|
||||
assert.sameValue(iterations, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(iter).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,65 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing an array BindingElementList pattern (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[x, y, z]]) {
|
||||
assert.sameValue(x, 3);
|
||||
assert.sameValue(y, 4);
|
||||
assert.sameValue(z, 5);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([3, 4, 5]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,71 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing an elision (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[,]]) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(g()).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing an "empty" array pattern (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ ]
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iterations = 0;
|
||||
var iter = function*() {
|
||||
iterations += 1;
|
||||
}();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[]]) {
|
||||
assert.sameValue(iterations, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(iter).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing a rest element (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var values = [1, 2, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[...x]]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 1);
|
||||
assert.sameValue(x[1], 2);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.notSameValue(x, values);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(values).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
|
||||
1. If Elision is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with
|
||||
iteratorRecord as the argument.
|
||||
b. ReturnIfAbrupt(status).
|
||||
2. Return the result of performing IteratorBindingInitialization for
|
||||
BindingRestElement with iteratorRecord and environment as arguments.
|
||||
---*/
|
||||
var values = [1, 2, 3, 4, 5];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([ , , ...x]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 3);
|
||||
assert.sameValue(x[1], 4);
|
||||
assert.sameValue(x[2], 5);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(values).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: RestElement applied to an exhausted iterator (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
BindingRestElement : ... BindingIdentifier
|
||||
1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
|
||||
environment).
|
||||
2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. If environment is undefined, return PutValue(lhs, A).
|
||||
ii. Return InitializeReferencedBinding(lhs, A).
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([, , ...x]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Lone rest element (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
BindingRestElement : ... BindingIdentifier
|
||||
[...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
|
||||
[...]
|
||||
f. Let status be CreateDataProperty(A, ToString (n), nextValue).
|
||||
[...]
|
||||
---*/
|
||||
var values = [1, 2, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 1);
|
||||
assert.sameValue(x[1], 2);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(values).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-ary.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Reset element (nested array pattern) does not support initializer (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[ x ] = []]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Reset element (identifier) does not support initializer (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x = []]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-obj.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Reset element (nested object pattern) does not support initializer (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ x } = []]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element (array binding pattern) may not be followed by any element (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[x], y]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element (identifier) may not be followed by any element (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x, y]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element (object binding pattern) may not be followed by any element (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ x }, y]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-obj-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing an object binding pattern (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ length }]) {
|
||||
assert.sameValue(length, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([1, 2, 3]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element containing an object binding pattern (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
|
||||
assert.sameValue(v, 7);
|
||||
assert.sameValue(w, 8);
|
||||
assert.sameValue(x, 9);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
length;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f([7, 8, 9]).next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-close.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Iterator is closed when not exhausted by pattern evaluation (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var doneCallCount = 0;
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return { value: null, done: false };
|
||||
},
|
||||
return: function() {
|
||||
doneCallCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x] = iter) {
|
||||
assert.sameValue(doneCallCount, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-no-close.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Iterator is not closed when exhausted by pattern evaluation (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||
result).
|
||||
[...]
|
||||
|
||||
---*/
|
||||
var doneCallCount = 0;
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return { value: null, done: true };
|
||||
},
|
||||
return: function() {
|
||||
doneCallCount += 1;
|
||||
return {};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x] = iter) {
|
||||
assert.sameValue(doneCallCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-name-iter-val.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding with normal value iteration (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x, y, z] = [1, 2, 3]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, 2);
|
||||
assert.sameValue(z, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[x, y, z] = [4, 5, 6]] = []) {
|
||||
assert.sameValue(x, 4);
|
||||
assert.sameValue(y, 5);
|
||||
assert.sameValue(z, 6);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
|
||||
assert.sameValue(x, 7);
|
||||
assert.sameValue(y, 8);
|
||||
assert.sameValue(z, 9);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[,] = g()] = []) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
---*/
|
||||
var callCount = 0;
|
||||
function* g() {
|
||||
callCount += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[,] = g()] = [[]]) {
|
||||
assert.sameValue(callCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var initCount = 0;
|
||||
var iterCount = 0;
|
||||
var iter = function*() { iterCount += 1; }();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[] = function() { initCount += 1; return iter; }()] = []) {
|
||||
assert.sameValue(initCount, 1);
|
||||
assert.sameValue(iterCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var initCount = 0;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[] = function() { initCount += 1; }()] = [[23]]) {
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var values = [2, 1, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[...x] = values] = []) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x[0], 2);
|
||||
assert.sameValue(x[1], 1);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with array binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
[...]
|
||||
e. Else,
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
var values = [2, 1, 3];
|
||||
var initCount = 0;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([[...x] = function() { initCount += 1; }()] = [values]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x[0], 2);
|
||||
assert.sameValue(x[1], 1);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.notSameValue(x, values);
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer with an exhausted iterator (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23] = []) {
|
||||
assert.sameValue(x, 23);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding does assign name to arrow functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([arrow = () => {}] = []) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns `name` to "anonymous" classes (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([cover = (function () {}), xCover = (0, function() {})] = []) {
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
assert.notSameValue(xCover.name, 'xCover');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([fn = function () {}, xFn = function x() {}] = []) {
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
assert.notSameValue(xFn.name, 'xFn');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" generator functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([gen = function* () {}, xGen = function* x() {}] = []) {
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
assert.notSameValue(xGen.name, 'xGen');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer with a "hole" (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
[...] 6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23] = [,]) {
|
||||
assert.sameValue(x, 23);
|
||||
// another statement
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is not evaluated when value is not `undefined` (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function counter() {
|
||||
initCount += 1;
|
||||
}
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
|
||||
assert.sameValue(w, null);
|
||||
assert.sameValue(x, 0);
|
||||
assert.sameValue(y, false);
|
||||
assert.sameValue(z, '');
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer with an undefined value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
[...]
|
||||
7. If environment is undefined, return PutValue(lhs, v).
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x = 23] = [undefined]) {
|
||||
assert.sameValue(x, 23);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration completes (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x] = []) {
|
||||
assert.sameValue(x, undefined);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration was completed previously (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([_, x] = []) {
|
||||
assert.sameValue(x, undefined);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding when value iteration was completed previously (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([x, y, z] = [1, 2, 3]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, 2);
|
||||
assert.sameValue(z, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
|
||||
assert.sameValue(x, 44);
|
||||
assert.sameValue(y, 55);
|
||||
assert.sameValue(z, 66);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
|
||||
assert.sameValue(x, 11);
|
||||
assert.sameValue(y, 22);
|
||||
assert.sameValue(z, 33);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
|
||||
assert.sameValue(v, 444);
|
||||
assert.sameValue(x, 555);
|
||||
assert.sameValue(z, 666);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
u;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
w;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
y;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: BindingElement with object binding pattern and initializer is not used (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPatternInitializer opt
|
||||
|
||||
[...]
|
||||
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be ? GetValue(defaultValue).
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
|
||||
assert.sameValue(v, 777);
|
||||
assert.sameValue(x, 888);
|
||||
assert.sameValue(z, 999);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
u;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
w;
|
||||
});
|
||||
assert.throws(ReferenceError, function() {
|
||||
y;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Elision accepts exhausted iterator (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iter = function*() {}();
|
||||
iter.next();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([,] = iter) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,58 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Elision advances iterator (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([,] = g()) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-empty.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: No iteration occurs for an "empty" array binding pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ ]
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iterations = 0;
|
||||
var iter = function*() {
|
||||
iterations += 1;
|
||||
}();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([] = iter) {
|
||||
assert.sameValue(iterations, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,65 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing an array BindingElementList pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
e. Else,
|
||||
[...]
|
||||
i. Let v be IteratorValue(next).
|
||||
ii. If v is an abrupt completion, set
|
||||
iteratorRecord.[[done]] to true.
|
||||
iii. ReturnIfAbrupt(v).
|
||||
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||
[...]
|
||||
8. Return InitializeReferencedBinding(lhs, v).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[x, y, z]] = [3, 4, 5]) {
|
||||
assert.sameValue(x, 3);
|
||||
assert.sameValue(y, 4);
|
||||
assert.sameValue(z, 5);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,71 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing an elision (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ Elision ]
|
||||
|
||||
1. Return the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||
as the argument.
|
||||
|
||||
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||
|
||||
Elision : ,
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||
c. ReturnIfAbrupt(next).
|
||||
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||
2. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
function* g() {
|
||||
first += 1;
|
||||
yield;
|
||||
second += 1;
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[,]] = g()) {
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing an "empty" array pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
ArrayBindingPattern : [ ]
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
|
||||
---*/
|
||||
var iterations = 0;
|
||||
var iter = function*() {
|
||||
iterations += 1;
|
||||
}();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[]] = iter) {
|
||||
assert.sameValue(iterations, 1);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing a rest element (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var values = [1, 2, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[...x]] = values) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 1);
|
||||
assert.sameValue(x[1], 2);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.notSameValue(x, values);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
|
||||
1. If Elision is present, then
|
||||
a. Let status be the result of performing
|
||||
IteratorDestructuringAssignmentEvaluation of Elision with
|
||||
iteratorRecord as the argument.
|
||||
b. ReturnIfAbrupt(status).
|
||||
2. Return the result of performing IteratorBindingInitialization for
|
||||
BindingRestElement with iteratorRecord and environment as arguments.
|
||||
---*/
|
||||
var values = [1, 2, 3, 4, 5];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([ , , ...x] = values) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 3);
|
||||
assert.sameValue(x[1], 4);
|
||||
assert.sameValue(x[2], 5);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: RestElement applied to an exhausted iterator (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
BindingRestElement : ... BindingIdentifier
|
||||
1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
|
||||
environment).
|
||||
2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. If environment is undefined, return PutValue(lhs, A).
|
||||
ii. Return InitializeReferencedBinding(lhs, A).
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([, , ...x] = [1, 2]) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Lone rest element (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
BindingRestElement : ... BindingIdentifier
|
||||
[...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
|
||||
[...]
|
||||
f. Let status be CreateDataProperty(A, ToString (n), nextValue).
|
||||
[...]
|
||||
---*/
|
||||
var values = [1, 2, 3];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x] = values) {
|
||||
assert(Array.isArray(x));
|
||||
assert.sameValue(x.length, 3);
|
||||
assert.sameValue(x[0], 1);
|
||||
assert.sameValue(x[1], 2);
|
||||
assert.sameValue(x[2], 3);
|
||||
assert.notSameValue(x, values);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-ary.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Reset element (nested array pattern) does not support initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[ x ] = []] = []) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Reset element (identifier) does not support initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x = []] = []) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-init-obj.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Reset element (nested object pattern) does not support initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ x } = []] = []) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element (array binding pattern) may not be followed by any element (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...[x], y] = [1, 2, 3]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element (identifier) may not be followed by any element (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...x, y] = [1, 2, 3]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element (object binding pattern) may not be followed by any element (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
ArrayBindingPattern[Yield] :
|
||||
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||
[ BindingElementList[?Yield] ]
|
||||
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ x }, y] = [1, 2, 3]) {
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-obj-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing an object binding pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ length }] = [1, 2, 3]) {
|
||||
assert.sameValue(length, 3);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element containing an object binding pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingRestElement : ... BindingPattern
|
||||
|
||||
1. Let A be ArrayCreate(0).
|
||||
[...]
|
||||
3. Repeat
|
||||
[...]
|
||||
b. If iteratorRecord.[[done]] is true, then
|
||||
i. Return the result of performing BindingInitialization of
|
||||
BindingPattern with A and environment as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*([...{ 0: v, 1: w, 2: x, 3: y, length: z }] = [7, 8, 9]) {
|
||||
assert.sameValue(v, 7);
|
||||
assert.sameValue(w, 8);
|
||||
assert.sameValue(x, 9);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
length;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-empty.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: No property access occurs for an "empty" object binding pattern (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
Runtime Semantics: BindingInitialization
|
||||
|
||||
ObjectBindingPattern : { }
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
---*/
|
||||
var accessCount = 0;
|
||||
var obj = Object.defineProperty({}, 'attr', {
|
||||
get: function() {
|
||||
accessCount += 1;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({} = obj) {
|
||||
assert.sameValue(accessCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-fn-name-arrow.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns `name` to arrow functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer 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,
|
||||
bindingId).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ arrow = () => {} } = {}) {
|
||||
assert.sameValue(arrow.name, 'arrow');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-fn-name-class.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns `name` to "anonymous" classes (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer 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,
|
||||
bindingId).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ cls = class {}, xCls = class X {}, xCls2 = class { static name() {} } } = {}) {
|
||||
assert.sameValue(cls.name, 'cls');
|
||||
assert.notSameValue(xCls.name, 'xCls');
|
||||
assert.notSameValue(xCls2.name, 'xCls2');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-fn-name-cover.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns `name` to "anonymous" functions "through" cover grammar (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer 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,
|
||||
bindingId).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ cover = (function () {}), xCover = (0, function() {}) } = {}) {
|
||||
assert.sameValue(cover.name, 'cover');
|
||||
assert.notSameValue(xCover.name, 'xCover');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-fn-name-fn.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer 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,
|
||||
bindingId).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ fn = function () {}, xFn = function x() {} } = {}) {
|
||||
assert.sameValue(fn.name, 'fn');
|
||||
assert.notSameValue(xFn.name, 'xFn');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-fn-name-gen.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: SingleNameBinding assigns name to "anonymous" generator functions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer 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,
|
||||
bindingId).
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ gen = function* () {}, xGen = function* x() {} } = {}) {
|
||||
assert.sameValue(gen.name, 'gen');
|
||||
assert.notSameValue(xGen.name, 'xGen');
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-skipped.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is not evaluated when value is not `undefined` (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
6. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
[...]
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function counter() {
|
||||
initCount += 1;
|
||||
}
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) {
|
||||
assert.sameValue(w, null);
|
||||
assert.sameValue(x, 0);
|
||||
assert.sameValue(y, false);
|
||||
assert.sameValue(z, '');
|
||||
assert.sameValue(initCount, 0);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-trailing-comma.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Trailing comma is allowed following BindingPropertyList (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
ObjectBindingPattern[Yield] :
|
||||
{ }
|
||||
{ BindingPropertyList[?Yield] }
|
||||
{ BindingPropertyList[?Yield] , }
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ x, } = { x: 23 }) {
|
||||
assert.sameValue(x, 23);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-init.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" array binding pattern using initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ w: [x, y, z] = [4, 5, 6] } = {}) {
|
||||
assert.sameValue(x, 4);
|
||||
assert.sameValue(y, 5);
|
||||
assert.sameValue(z, 6);
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
w;
|
||||
});
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-trailing-comma.case
|
||||
// - src/dstr-binding/default/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Trailing comma is allowed following BindingPropertyList (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) {
|
||||
AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, scope, strict).
|
||||
[...]
|
||||
|
||||
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
ObjectBindingPattern[Yield] :
|
||||
{ }
|
||||
{ BindingPropertyList[?Yield] }
|
||||
{ BindingPropertyList[?Yield] , }
|
||||
---*/
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = async function*({ x: [y], } = { x: [45] }) {
|
||||
assert.sameValue(y,45);
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next().then(() => {
|
||||
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||
}).then($DONE, $DONE);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue