Generate tests

This commit is contained in:
Leonardo Balter 2017-03-16 16:24:49 -04:00 committed by Leo Balter
parent 3a4e3bd8b1
commit 66f42efc99
No known key found for this signature in database
GPG Key ID: 2C75F319D398E36B
48 changed files with 2294 additions and 0 deletions

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-non-strict.case
// - src/async-generators/non-strict/async-expression-named.template
/*---
description: Use of yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator named expression - valid for non-strict only cases)
esid: prod-AsyncGeneratorExpression
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = async function *g() {
callCount += 1;
return (function(arg) {
var yield = arg + 1;
return yield;
}(yield))
};
var iter = gen();
var item = iter.next();
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value, undefined);
});
item = iter.next(42);
item.then(({ done, value }) => {
assert.sameValue(done, true);
assert.sameValue(value, 43);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-non-strict.case
// - src/async-generators/non-strict/async-expression-named.template
/*---
description: Mixed use of object spread and yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator named expression - valid for non-strict only cases)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *g() {
callCount += 1;
yield {
...yield yield,
...(function(arg) {
var yield = arg;
return {...yield};
}(yield)),
...yield,
}
};
var iter = gen();
var iter = gen();
iter.next();
iter.next();
iter.next({ x: 10, a: 0, b: 0 });
iter.next({ y: 20, a: 1, b: 1 });
var item = iter.next({ z: 30, b: 2 });
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value.x, 10);
assert.sameValue(value.y, 20);
assert.sameValue(value.z, 30);
assert.sameValue(value.a, 1);
assert.sameValue(value.b, 2);
assert.sameValue(Object.keys(value).length, 5);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-expression-named.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Named async generator expression)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *g() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
};
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,34 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-expression-named.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Named async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = async function *g() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
};
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-expression-named.template
/*---
description: Use yield value in a array spread position (Named async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
var gen = async function *g() {
callCount += 1;
yield [...yield yield];
};
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,42 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-expression-named.template
/*---
description: Use yield value in a array spread position (Named async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
var gen = async function *g() {
callCount += 1;
yield [...yield];
};
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-expression-named.template
/*---
description: Use yield value in a object spread position (Named async generator expression)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *g() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
};
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-non-strict.case
// - src/async-generators/non-strict/async-expression.template
/*---
description: Use of yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator expression - valid for non-strict only cases)
esid: prod-AsyncGeneratorExpression
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = async function *() {
callCount += 1;
return (function(arg) {
var yield = arg + 1;
return yield;
}(yield))
};
var iter = gen();
var item = iter.next();
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value, undefined);
});
item = iter.next(42);
item.then(({ done, value }) => {
assert.sameValue(done, true);
assert.sameValue(value, 43);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-non-strict.case
// - src/async-generators/non-strict/async-expression.template
/*---
description: Mixed use of object spread and yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator expression - valid for non-strict only cases)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *() {
callCount += 1;
yield {
...yield yield,
...(function(arg) {
var yield = arg;
return {...yield};
}(yield)),
...yield,
}
};
var iter = gen();
var iter = gen();
iter.next();
iter.next();
iter.next({ x: 10, a: 0, b: 0 });
iter.next({ y: 20, a: 1, b: 1 });
var item = iter.next({ z: 30, b: 2 });
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value.x, 10);
assert.sameValue(value.y, 20);
assert.sameValue(value.z, 30);
assert.sameValue(value.a, 1);
assert.sameValue(value.b, 2);
assert.sameValue(Object.keys(value).length, 5);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-expression.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Unnamed async generator expression)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
};
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,34 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-expression.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Unnamed async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = async function *() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
};
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-expression.template
/*---
description: Use yield value in a array spread position (Unnamed async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
var gen = async function *() {
callCount += 1;
yield [...yield yield];
};
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,42 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-expression.template
/*---
description: Use yield value in a array spread position (Unnamed async generator expression)
esid: prod-AsyncGeneratorExpression
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
var gen = async function *() {
callCount += 1;
yield [...yield];
};
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-expression.template
/*---
description: Use yield value in a object spread position (Unnamed async generator expression)
esid: prod-AsyncGeneratorExpression
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorExpression :
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = async function *() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
};
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-class-expr-static-method.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var C = class { static async *gen() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}}
var gen = C.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-class-expr-static-method.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
var C = class { static async *gen() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}}
var gen = C.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-class-expr-static-method.template
/*---
description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
var C = class { static async *gen() {
callCount += 1;
yield [...yield yield];
}}
var gen = C.gen;
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,49 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-class-expr-static-method.template
/*---
description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
var C = class { static async *gen() {
callCount += 1;
yield [...yield];
}}
var gen = C.gen;
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-class-expr-static-method.template
/*---
description: Use yield value in a object spread position (Static async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var C = class { static async *gen() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}}
var gen = C.gen;
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-class-expr-method.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var C = class { async *gen() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}}
var gen = C.prototype.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-class-expr-method.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
var C = class { async *gen() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}}
var gen = C.prototype.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-class-expr-method.template
/*---
description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
var C = class { async *gen() {
callCount += 1;
yield [...yield yield];
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,49 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-class-expr-method.template
/*---
description: Use yield value in a array spread position (Async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
var C = class { async *gen() {
callCount += 1;
yield [...yield];
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-class-expr-method.template
/*---
description: Use yield value in a object spread position (Async generator method as a ClassExpression element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var C = class { async *gen() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-non-strict.case
// - src/async-generators/non-strict/async-obj-method.template
/*---
description: Use of yield as a valid identifier in a function body inside a generator body in non strict mode (Generator method - valid for non-strict only cases)
esid: prod-AsyncGeneratorMethod
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
return (function(arg) {
var yield = arg + 1;
return yield;
}(yield))
}
}.method;
var iter = gen();
var item = iter.next();
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value, undefined);
});
item = iter.next(42);
item.then(({ done, value }) => {
assert.sameValue(done, true);
assert.sameValue(value, 43);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,60 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-non-strict.case
// - src/async-generators/non-strict/async-obj-method.template
/*---
description: Mixed use of object spread and yield as a valid identifier in a function body inside a generator body in non strict mode (Generator method - valid for non-strict only cases)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
yield {
...yield yield,
...(function(arg) {
var yield = arg;
return {...yield};
}(yield)),
...yield,
}
}
}.method;
var iter = gen();
var iter = gen();
iter.next();
iter.next();
iter.next({ x: 10, a: 0, b: 0 });
iter.next({ y: 20, a: 1, b: 1 });
var item = iter.next({ z: 30, b: 2 });
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value.x, 10);
assert.sameValue(value.y, 20);
assert.sameValue(value.z, 30);
assert.sameValue(value.a, 1);
assert.sameValue(value.b, 2);
assert.sameValue(Object.keys(value).length, 5);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-obj-method.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async generator method)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}
}.method;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,34 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-obj-method.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method)
esid: prod-AsyncGeneratorMethod
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}
}.method;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-obj-method.template
/*---
description: Use yield value in a array spread position (Async generator method)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
yield [...yield yield];
}
}.method;
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,42 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-obj-method.template
/*---
description: Use yield value in a array spread position (Async generator method)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
yield [...yield];
}
}.method;
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-obj-method.template
/*---
description: Use yield value in a object spread position (Async generator method)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
var gen = {
async *method() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}
}.method;
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-non-strict.case
// - src/async-generators/non-strict/async-declaration.template
/*---
description: Use of yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator function declaration - valid for non-strict only cases)
esid: prod-AsyncGeneratorDeclaration
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
async function *gen() {
callCount += 1;
return (function(arg) {
var yield = arg + 1;
return yield;
}(yield))
}
var iter = gen();
var item = iter.next();
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value, undefined);
});
item = iter.next(42);
item.then(({ done, value }) => {
assert.sameValue(done, true);
assert.sameValue(value, 43);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,59 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-non-strict.case
// - src/async-generators/non-strict/async-declaration.template
/*---
description: Mixed use of object spread and yield as a valid identifier in a function body inside a generator body in non strict mode (Async generator function declaration - valid for non-strict only cases)
esid: prod-AsyncGeneratorDeclaration
features: [object-spread]
flags: [generated, noStrict, async]
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
async function *gen() {
callCount += 1;
yield {
...yield yield,
...(function(arg) {
var yield = arg;
return {...yield};
}(yield)),
...yield,
}
}
var iter = gen();
var iter = gen();
iter.next();
iter.next();
iter.next({ x: 10, a: 0, b: 0 });
iter.next({ y: 20, a: 1, b: 1 });
var item = iter.next({ z: 30, b: 2 });
item.then(({ done, value }) => {
assert.sameValue(done, false);
assert.sameValue(value.x, 10);
assert.sameValue(value.y, 20);
assert.sameValue(value.z, 30);
assert.sameValue(value.a, 1);
assert.sameValue(value.b, 2);
assert.sameValue(Object.keys(value).length, 5);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-declaration.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async generator Function declaration)
esid: prod-AsyncGeneratorDeclaration
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
async function *gen() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,34 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-declaration.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator Function declaration)
esid: prod-AsyncGeneratorDeclaration
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
---*/
var callCount = 0;
async function *gen() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,47 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-declaration.template
/*---
description: Use yield value in a array spread position (Async generator Function declaration)
esid: prod-AsyncGeneratorDeclaration
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
async function *gen() {
callCount += 1;
yield [...yield yield];
}
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,42 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-declaration.template
/*---
description: Use yield value in a array spread position (Async generator Function declaration)
esid: prod-AsyncGeneratorDeclaration
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
async function *gen() {
callCount += 1;
yield [...yield];
}
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-declaration.template
/*---
description: Use yield value in a object spread position (Async generator Function declaration)
esid: prod-AsyncGeneratorDeclaration
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
Async Generator Function Definitions
AsyncGeneratorDeclaration:
async [no LineTerminator here] function * BindingIdentifier ( FormalParameters ) {
AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
async function *gen() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-class-decl-static-method.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
class C { static async *gen() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}}
var gen = C.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-class-decl-static-method.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static async generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
class C { static async *gen() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}}
var gen = C.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-class-decl-static-method.template
/*---
description: Use yield value in a array spread position (Static async generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
class C { static async *gen() {
callCount += 1;
yield [...yield yield];
}}
var gen = C.gen;
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,49 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-class-decl-static-method.template
/*---
description: Use yield value in a array spread position (Static async generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
class C { static async *gen() {
callCount += 1;
yield [...yield];
}}
var gen = C.gen;
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-class-decl-static-method.template
/*---
description: Use yield value in a object spread position (Static async generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
static MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
class C { static async *gen() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}}
var gen = C.gen;
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,51 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-spread-strict.case
// - src/async-generators/default/async-class-decl-method.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Async Generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
class C { async *gen() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
}}
var gen = C.prototype.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-identifier-strict.case
// - src/async-generators/default/async-class-decl-method.template
/*---
description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async Generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
---*/
var callCount = 0;
class C { async *gen() {
callCount += 1;
(function() {
var yield;
throw new Test262Error();
}())
}}
var gen = C.prototype.gen;
var iter = gen();
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,54 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-multiple.case
// - src/async-generators/default/async-class-decl-method.template
/*---
description: Use yield value in a array spread position (Async Generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var item;
var callCount = 0;
class C { async *gen() {
callCount += 1;
yield [...yield yield];
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next(false);
item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
item = iter.next(value);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
}).catch($DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,49 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-arr-single.case
// - src/async-generators/default/async-class-decl-method.template
/*---
description: Use yield value in a array spread position (Async Generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Array Initializer
SpreadElement[Yield, Await]:
...AssignmentExpression[+In, ?Yield, ?Await]
---*/
var arr = ['a', 'b', 'c'];
var callCount = 0;
class C { async *gen() {
callCount += 1;
yield [...yield];
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next(false);
var item = iter.next(['a', 'b', 'c']);
item.then(({ done, value }) => {
assert(compareArray(value, arr));
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);

View File

@ -0,0 +1,58 @@
// This file was procedurally generated from the following sources:
// - src/async-generators/yield-spread-obj.case
// - src/async-generators/default/async-class-decl-method.template
/*---
description: Use yield value in a object spread position (Async Generator method as a ClassDeclaration element)
esid: prod-AsyncGeneratorMethod
features: [object-spread]
flags: [generated, async]
includes: [compareArray.js]
info: |
ClassElement :
MethodDefinition
MethodDefinition :
AsyncGeneratorMethod
Async Generator Function Definitions
AsyncGeneratorMethod :
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
var callCount = 0;
class C { async *gen() {
callCount += 1;
yield {
...yield,
y: 1,
...yield yield,
};
}}
var gen = C.prototype.gen;
var iter = gen();
iter.next();
iter.next({ x: 42 });
iter.next({ x: 'lol' });
var item = iter.next({ y: 39 });
item.then(({ done, value }) => {
assert.sameValue(value.x, 42);
assert.sameValue(value.y, 39);
assert.sameValue(Object.keys(value).length, 2);
assert.sameValue(done, false);
}).then($DONE, $DONE);
assert.sameValue(callCount, 1);