mirror of https://github.com/tc39/test262.git
Generate tests
This commit is contained in:
parent
05e54bb076
commit
4459447eb7
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-get-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Abrupt completion returned by GetIterator (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
|
||||
---*/
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Nested array destructuring with a null value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([[x]]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([null]);
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([x = (function() { throw new Test262Error(); })()]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f([undefined]);
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([ x = unresolvableReference ]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f([]);
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(g);
|
||||
});
|
|
@ -0,0 +1,56 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(g);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Nested object destructuring with a null value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([{ x }]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([null]);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Nested object destructuring with a value of `undefined` (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([{ x }]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([]);
|
||||
});
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Elision advances iterator and forwards abrupt completions (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
|
||||
---*/
|
||||
var following = 0;
|
||||
var iter =function* () {
|
||||
throw new Test262Error();
|
||||
following += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([,]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(following, 0, 'Iterator was properly closed.');
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
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 iter = (function*() { throw new Test262Error(); })();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([, ...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
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,
|
||||
a. If iteratorRecord.[[done]] is false,
|
||||
i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
iii. ReturnIfAbrupt(next).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
var iter = function*() {
|
||||
first += 1;
|
||||
throw new Test262Error();
|
||||
second += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
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,
|
||||
[...]
|
||||
c. Let nextValue be IteratorValue(next).
|
||||
d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*([...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,38 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-get-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Abrupt completion returned by GetIterator (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
|
||||
---*/
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
|
||||
var f = async function*([x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Nested array destructuring with a null value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*([[x]] = [null]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*([x = (function() { throw new Test262Error(); })()] = [undefined]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*([ x = unresolvableReference ] = []) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f = async function*([x] = g) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,55 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f = async function*([x] = g) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Nested object destructuring with a null value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*([{ x }] = [null]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Nested object destructuring with a value of `undefined` (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*([{ x }] = []) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Elision advances iterator and forwards abrupt completions (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated]
|
||||
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).
|
||||
|
||||
---*/
|
||||
var following = 0;
|
||||
var iter =function* () {
|
||||
throw new Test262Error();
|
||||
following += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f = async function*([,] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(following, 0, 'Iterator was properly closed.');
|
|
@ -0,0 +1,38 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
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 iter = (function*() { throw new Test262Error(); })();
|
||||
|
||||
|
||||
var f = async function*([, ...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
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,
|
||||
a. If iteratorRecord.[[done]] is false,
|
||||
i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
iii. ReturnIfAbrupt(next).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
var iter = function*() {
|
||||
first += 1;
|
||||
throw new Test262Error();
|
||||
second += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f = async function*([...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
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,
|
||||
[...]
|
||||
c. Let nextValue be IteratorValue(next).
|
||||
d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f = async function*([...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,32 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (null) (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 f = async function*({} = null) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,32 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-undefined.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (undefined) (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 f = async function*({} = undefined) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
[...]
|
||||
4. Let v be GetV(value, propertyName).
|
||||
5. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f = async function*({ poisoned } = poisonedProperty) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f = async function*({ x = thrower() } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*({ x = unresolvableReference } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-list-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Binding property list evaluation is interrupted by an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingPropertyList : BindingPropertyList , BindingProperty
|
||||
|
||||
1. Let status be the result of performing BindingInitialization for
|
||||
BindingPropertyList using value and environment as arguments.
|
||||
2. ReturnIfAbrupt(status).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f = async function*({ a, b = thrower(), c = ++initCount } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
assert.sameValue(initCount, 0);
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" array binding pattern taking the `null` value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-eval-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Evaluation of property name returns an abrupt completion (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingProperty : PropertyName : BindingElement
|
||||
|
||||
1. Let P be the result of evaluating PropertyName
|
||||
2. ReturnIfAbrupt(P).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f = async function*({ [thrower()]: x } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. Let v be GetV(value, propertyName).
|
||||
2. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var initEvalCount = 0;
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f = async function*({ poisoned: x = ++initEvalCount } = poisonedProperty) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
assert.sameValue(initEvalCount, 0);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f = async function*({ x: y = thrower() } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*({ x: y = unresolvableReference } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f = async function*({ w: { x, y, z } = undefined } = { }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-get-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Abrupt completion returned by GetIterator (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
|
||||
---*/
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Nested array destructuring with a null value (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([[x]]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([null]);
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x = (function() { throw new Test262Error(); })()]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f([undefined]);
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([ x = unresolvableReference ]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f([]);
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(g);
|
||||
});
|
|
@ -0,0 +1,56 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(g);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Nested object destructuring with a null value (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([{ x }]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([null]);
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Nested object destructuring with a value of `undefined` (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([{ x }]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f([]);
|
||||
});
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Elision advances iterator and forwards abrupt completions (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
|
||||
---*/
|
||||
var following = 0;
|
||||
var iter =function* () {
|
||||
throw new Test262Error();
|
||||
following += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([,]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(following, 0, 'Iterator was properly closed.');
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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 iter = (function*() { throw new Test262Error(); })();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([, ...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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,
|
||||
a. If iteratorRecord.[[done]] is false,
|
||||
i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
iii. ReturnIfAbrupt(next).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
var iter = function*() {
|
||||
first += 1;
|
||||
throw new Test262Error();
|
||||
second += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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,
|
||||
[...]
|
||||
c. Let nextValue be IteratorValue(next).
|
||||
d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([...x]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(iter);
|
||||
});
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-init-iter-get-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Abrupt completion returned by GetIterator (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
|
||||
---*/
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
throw new Test262Error();
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-ary-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Nested array destructuring with a null value (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ArrayBindingPattern
|
||||
|
||||
1. Let iterator be GetIterator(value).
|
||||
2. ReturnIfAbrupt(iterator).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([[x]] = [null]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x = (function() { throw new Test262Error(); })()] = [undefined]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([ x = unresolvableReference ] = []) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x] = g) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,56 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var g = {};
|
||||
g[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([x] = g) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Nested object destructuring with a null value (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([{ x }] = [null]) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Nested object destructuring with a value of `undefined` (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. If iteratorRecord.[[done]] is false, then
|
||||
[...]
|
||||
e. Else
|
||||
i. Let v be IteratorValue(next).
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization of BindingPattern
|
||||
with v and environment as the arguments.
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPattern : ObjectBindingPattern
|
||||
|
||||
1. Let valid be RequireObjectCoercible(value).
|
||||
2. ReturnIfAbrupt(valid).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([{ x }] = []) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-elision-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Elision advances iterator and forwards abrupt completions (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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).
|
||||
|
||||
---*/
|
||||
var following = 0;
|
||||
var iter =function* () {
|
||||
throw new Test262Error();
|
||||
following += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([,] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(following, 0, 'Iterator was properly closed.');
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-elision-next-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Rest element following elision elements (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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 iter = (function*() { throw new Test262Error(); })();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([, ...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-step-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorStep returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [generators, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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,
|
||||
a. If iteratorRecord.[[done]] is false,
|
||||
i. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||
ii. If next is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
iii. ReturnIfAbrupt(next).
|
||||
|
||||
---*/
|
||||
var first = 0;
|
||||
var second = 0;
|
||||
var iter = function*() {
|
||||
first += 1;
|
||||
throw new Test262Error();
|
||||
second += 1;
|
||||
}();
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
iter.next();
|
||||
assert.sameValue(first, 1);
|
||||
assert.sameValue(second, 0, 'Iterator is closed following abrupt completion.');
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/ary-ptrn-rest-id-iter-val-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error forwarding when IteratorValue returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [Symbol.iterator, async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, 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,
|
||||
[...]
|
||||
c. Let nextValue be IteratorValue(next).
|
||||
d. If nextValue is an abrupt completion, set iteratorRecord.[[done]] to
|
||||
true.
|
||||
e. ReturnIfAbrupt(nextValue).
|
||||
|
||||
---*/
|
||||
var poisonedValue = Object.defineProperty({}, 'value', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
var iter = {};
|
||||
iter[Symbol.iterator] = function() {
|
||||
return {
|
||||
next: function() {
|
||||
return poisonedValue;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g([...x] = iter) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (null) (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
Runtime Semantics: BindingInitialization
|
||||
|
||||
ObjectBindingPattern : { }
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({} = null) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-undefined.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (undefined) (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
Runtime Semantics: BindingInitialization
|
||||
|
||||
ObjectBindingPattern : { }
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({} = undefined) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. Let v be GetV(value, propertyName).
|
||||
5. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ poisoned } = poisonedProperty) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x = thrower() } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x = unresolvableReference } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-list-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Binding property list evaluation is interrupted by an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPropertyList : BindingPropertyList , BindingProperty
|
||||
|
||||
1. Let status be the result of performing BindingInitialization for
|
||||
BindingPropertyList using value and environment as arguments.
|
||||
2. ReturnIfAbrupt(status).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ a, b = thrower(), c = ++initCount } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
assert.sameValue(initCount, 0);
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" array binding pattern taking the `null` value (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: [x, y, z] = [4, 5, 6] } = { w: null }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-eval-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Evaluation of property name returns an abrupt completion (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingProperty : PropertyName : BindingElement
|
||||
|
||||
1. Let P be the result of evaluating PropertyName
|
||||
2. ReturnIfAbrupt(P).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ [thrower()]: x } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. Let v be GetV(value, propertyName).
|
||||
2. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var initEvalCount = 0;
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ poisoned: x = ++initEvalCount } = poisonedProperty) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
||||
|
||||
assert.sameValue(initEvalCount, 0);
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x: y = thrower() } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x: y = unresolvableReference } = {}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: { x, y, z } = { x: 4, y: 5, z: 6 } } = { w: null }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator named function expression (default parameter))
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: { x, y, z } = undefined } = { }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (null) (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
Runtime Semantics: BindingInitialization
|
||||
|
||||
ObjectBindingPattern : { }
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f(null);
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-undefined.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (undefined) (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
Runtime Semantics: BindingInitialization
|
||||
|
||||
ObjectBindingPattern : { }
|
||||
|
||||
1. Return NormalCompletion(empty).
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f(undefined);
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
SingleNameBinding : BindingIdentifier Initializeropt
|
||||
|
||||
[...]
|
||||
4. Let v be GetV(value, propertyName).
|
||||
5. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ poisoned }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(poisonedProperty);
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x = thrower() }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x = unresolvableReference }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-list-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Binding property list evaluation is interrupted by an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingPropertyList : BindingPropertyList , BindingProperty
|
||||
|
||||
1. Let status be the result of performing BindingInitialization for
|
||||
BindingPropertyList using value and environment as arguments.
|
||||
2. ReturnIfAbrupt(status).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ a, b = thrower(), c = ++initCount }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
||||
|
||||
assert.sameValue(initCount, 0);
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" array binding pattern taking the `null` value (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: [x, y, z] = [4, 5, 6] }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ w: null });
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-eval-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Evaluation of property name returns an abrupt completion (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||
|
||||
BindingProperty : PropertyName : BindingElement
|
||||
|
||||
1. Let P be the result of evaluating PropertyName
|
||||
2. ReturnIfAbrupt(P).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ [thrower()]: x }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. Let v be GetV(value, propertyName).
|
||||
2. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var initEvalCount = 0;
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ poisoned: x = ++initEvalCount }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(poisonedProperty);
|
||||
});
|
||||
|
||||
assert.sameValue(initEvalCount, 0);
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x: y = thrower() }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ x: y = unresolvableReference }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ w: null });
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-named-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator named function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
info: |
|
||||
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
|
||||
( FormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
[...]
|
||||
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
|
||||
AsyncGeneratorBody, funcEnv, strict).
|
||||
[...]
|
||||
|
||||
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
|
||||
|
||||
[...]
|
||||
3. If Initializer is present and v is undefined, then
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function* g({ w: { x, y, z } = undefined }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ });
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (null) (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 f;
|
||||
f = async function*({}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f(null);
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-init-undefined.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Value specifed for object binding pattern must be object coercible (undefined) (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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 f;
|
||||
f = async function*({}) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f(undefined);
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
[...]
|
||||
4. Let v be GetV(value, propertyName).
|
||||
5. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ poisoned }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(poisonedProperty);
|
||||
});
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ x = thrower() }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
a. Let defaultValue be the result of evaluating Initializer.
|
||||
b. Let v be GetValue(defaultValue).
|
||||
c. ReturnIfAbrupt(v).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ x = unresolvableReference }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-list-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Binding property list evaluation is interrupted by an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingPropertyList : BindingPropertyList , BindingProperty
|
||||
|
||||
1. Let status be the result of performing BindingInitialization for
|
||||
BindingPropertyList using value and environment as arguments.
|
||||
2. ReturnIfAbrupt(status).
|
||||
---*/
|
||||
var initCount = 0;
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ a, b = thrower(), c = ++initCount }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
||||
|
||||
assert.sameValue(initCount, 0);
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-ary-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" array binding pattern taking the `null` value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ w: [x, y, z] = [4, 5, 6] }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ w: null });
|
||||
});
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-eval-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Evaluation of property name returns an abrupt completion (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingProperty : PropertyName : BindingElement
|
||||
|
||||
1. Let P be the result of evaluating PropertyName
|
||||
2. ReturnIfAbrupt(P).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ [thrower()]: x }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-get-value-err.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error thrown when accessing the corresponding property of the value object (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
1. Let v be GetV(value, propertyName).
|
||||
2. ReturnIfAbrupt(v).
|
||||
---*/
|
||||
var initEvalCount = 0;
|
||||
var poisonedProperty = Object.defineProperty({}, 'poisoned', {
|
||||
get: function() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ poisoned: x = ++initEvalCount }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f(poisonedProperty);
|
||||
});
|
||||
|
||||
assert.sameValue(initEvalCount, 0);
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-throws.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Error thrown when evaluating the initializer (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
---*/
|
||||
function thrower() {
|
||||
throw new Test262Error();
|
||||
}
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ x: y = thrower() }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Destructuring initializer is an unresolvable reference (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
|
||||
BindingElement : BindingPattern Initializeropt
|
||||
|
||||
[...]
|
||||
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).
|
||||
|
||||
6.2.3.1 GetValue (V)
|
||||
|
||||
1. ReturnIfAbrupt(V).
|
||||
2. If Type(V) is not Reference, return V.
|
||||
3. Let base be GetBase(V).
|
||||
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ x: y = unresolvableReference }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
f({});
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-null.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ w: { x, y, z } = { x: 4, y: 5, z: 6 } }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ w: null });
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-prop-obj-value-undef.case
|
||||
// - src/dstr-binding/error/async-gen-func-expr.template
|
||||
/*---
|
||||
description: Object binding pattern with "nested" object binding pattern taking the `null` value (async generator function expression)
|
||||
esid: sec-asyncgenerator-definitions-evaluation
|
||||
features: [async-iteration]
|
||||
flags: [generated]
|
||||
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
|
||||
[...]
|
||||
4. Return the result of performing BindingInitialization for BindingPattern
|
||||
passing v and environment as arguments.
|
||||
---*/
|
||||
|
||||
|
||||
var f;
|
||||
f = async function*({ w: { x, y, z } = undefined }) {
|
||||
|
||||
};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
f({ });
|
||||
});
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue