mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #1704 from leobalter/generate-tests-1699
Fix feature tags and trailing space and Generate tests
This commit is contained in:
commit
8f8b4d733a
@ -16,7 +16,7 @@ info: |
|
||||
|
||||
AsyncMethod :
|
||||
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||
features: [async-functions, class-methods-private]
|
||||
features: [async-functions, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
class C { static async #method() {
|
||||
|
@ -16,7 +16,7 @@ info: |
|
||||
|
||||
AsyncMethod :
|
||||
async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
|
||||
features: [async-functions, class-methods-private]
|
||||
features: [async-functions, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
var C = class { static async #method() {
|
||||
|
@ -16,7 +16,7 @@ info: |
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
features: [async-iteration, class-methods-private]
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
class C { static async *#gen() {
|
||||
|
@ -16,7 +16,7 @@ info: |
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
features: [async-iteration, class-methods-private]
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
|
@ -20,7 +20,7 @@ features: [generators, class-methods-private]
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class C {
|
||||
class C {
|
||||
*#gen() {
|
||||
callCount += 1;
|
||||
/*{ body }*/
|
||||
|
@ -15,7 +15,7 @@ info: |
|
||||
|
||||
GeneratorMethod :
|
||||
* # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
features: [generators, class-methods-private]
|
||||
features: [generators, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
class C {static *#gen() {
|
||||
|
@ -15,7 +15,7 @@ info: |
|
||||
|
||||
GeneratorMethod :
|
||||
* # PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||
features: [generators, class-methods-private]
|
||||
features: [generators, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
var C = class { static *#gen() {
|
||||
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-binding-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
var \u0061wait;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-binding-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
var await;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-identifier-reference-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
void \u0061wait;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-identifier-reference.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
void await;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-label-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
\u0061wait: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-label-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
await: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-binding-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
var \u0061wait;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-binding-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
var await;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-identifier-reference-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
void \u0061wait;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-identifier-reference.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
void await;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-label-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
\u0061wait: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/await-as-label-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Await] parameter and
|
||||
StringValue of Identifier is "await".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
await: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-binding-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
var yi\u0065ld;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-binding-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
var yield;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-identifier-reference-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
void yi\u0065ld;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-identifier-reference.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
void yield;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-label-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
yi\u0065ld: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-label-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { static async *#gen() {
|
||||
yield: ;
|
||||
}};
|
@ -0,0 +1,62 @@
|
||||
// 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-private-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-AsyncGeneratorPrivateMethod
|
||||
features: [object-spread, async-iteration, class-static-methods-private]
|
||||
flags: [generated, onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
Spread Properties
|
||||
|
||||
PropertyDefinition[Yield]:
|
||||
(...)
|
||||
...AssignmentExpression[In, ?Yield]
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
return {
|
||||
...(function() {
|
||||
var yield;
|
||||
throw new Test262Error();
|
||||
}()),
|
||||
}
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,53 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-identifier-strict.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-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-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
(function() {
|
||||
var yield;
|
||||
throw new Test262Error();
|
||||
}())
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,59 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next-catch.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield Promise.reject(error);
|
||||
yield "unreachable";
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}).catch(rejectValue => {
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,65 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next-for-await-of-async-iterator.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield * [Promise.reject(value)] is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
async function * readFile() {
|
||||
yield Promise.reject(error);
|
||||
yield "unreachable";
|
||||
}
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
for await (let line of readFile()) {
|
||||
yield line;
|
||||
}
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}, rejectValue => {
|
||||
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next-for-await-of-sync-iterator.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield Promise.reject(value) in for-await-of is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
let iterable = [
|
||||
Promise.reject(error),
|
||||
"unreachable"
|
||||
];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
for await (let value of iterable) {
|
||||
yield value;
|
||||
}
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}, rejectValue => {
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next-yield-star-async-iterator.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
async function * readFile() {
|
||||
yield Promise.reject(error);
|
||||
yield "unreachable";
|
||||
}
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield * readFile();
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}, rejectValue => {
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}, $DONE).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,62 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next-yield-star-sync-iterator.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
let iterable = [
|
||||
Promise.reject(error),
|
||||
"unreachable"
|
||||
];
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield * iterable;
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}, rejectValue => {
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,59 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-promise-reject-next.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
let error = new Error();
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield Promise.reject(error);
|
||||
yield "unreachable";
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error("Promise incorrectly resolved.");
|
||||
}, rejectValue => {
|
||||
// yield Promise.reject(error);
|
||||
assert.sameValue(rejectValue, error);
|
||||
|
||||
iter.next().then(({done, value}) => {
|
||||
// iter is closed now.
|
||||
assert.sameValue(done, true, "The value of IteratorResult.done is `true`");
|
||||
assert.sameValue(value, undefined, "The value of IteratorResult.value is `undefined`");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,65 @@
|
||||
// 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-private-method.template
|
||||
/*---
|
||||
description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
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];
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.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);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,64 @@
|
||||
// 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-private-method.template
|
||||
/*---
|
||||
description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
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];
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next(false);
|
||||
var item = iter.next(arr);
|
||||
|
||||
item.then(({ done, value }) => {
|
||||
assert.notSameValue(value, arr, 'value is a new array');
|
||||
assert(Array.isArray(value), 'value is an Array exotic object');
|
||||
assert.sameValue(value.length, 3)
|
||||
assert.sameValue(value[0], 'a');
|
||||
assert.sameValue(value[1], 'b');
|
||||
assert.sameValue(value[2], 'c');
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,68 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-spread-obj.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Use yield value in a object spread position (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [object-spread, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
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,
|
||||
};
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.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);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,234 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-async-next.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Execution order for yield* with async iterator and next() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
log.push({ name: "get [Symbol.iterator]" });
|
||||
},
|
||||
get [Symbol.asyncIterator]() {
|
||||
log.push({
|
||||
name: "get [Symbol.asyncIterator]",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call [Symbol.asyncIterator]",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
var nextCount = 0;
|
||||
return {
|
||||
name: "asyncIterator",
|
||||
get next() {
|
||||
log.push({
|
||||
name: "get next",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call next",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
nextCount++;
|
||||
if (nextCount == 1) {
|
||||
return {
|
||||
name: "next-promise-1",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get next then (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call next then (1)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "next-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get next value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "next-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get next done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "next-promise-2",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get next then (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call next then (2)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "next-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get next value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "next-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get next done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
var v = yield* obj;
|
||||
log.push({
|
||||
name: "after yield*",
|
||||
value: v
|
||||
});
|
||||
return "return-value";
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next("next-arg-1").then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
|
||||
assert.sameValue(log[1].thisValue, obj, "get [Symbol.asyncIterator] thisValue");
|
||||
|
||||
assert.sameValue(log[2].name, "call [Symbol.asyncIterator]");
|
||||
assert.sameValue(log[2].thisValue, obj, "[Symbol.asyncIterator] thisValue");
|
||||
assert.sameValue(log[2].args.length, 0, "[Symbol.asyncIterator] args.length");
|
||||
|
||||
assert.sameValue(log[3].name, "get next");
|
||||
assert.sameValue(log[3].thisValue.name, "asyncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[4].name, "call next");
|
||||
assert.sameValue(log[4].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[4].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[4].args[0], undefined, "next args[0]");
|
||||
|
||||
assert.sameValue(log[5].name, "get next then (1)");
|
||||
assert.sameValue(log[5].thisValue.name, "next-promise-1", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[6].name, "call next then (1)");
|
||||
assert.sameValue(log[6].thisValue.name, "next-promise-1", "next then thisValue");
|
||||
assert.sameValue(log[6].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[6].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[6].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[7].name, "get next done (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[8].name, "get next value (1)");
|
||||
assert.sameValue(log[8].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 9, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[9].name, "call next");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "next thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[9].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[10].name, "get next then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "next-promise-2", "get next then thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call next then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "next-promise-2", "next then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "next then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "next then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "next then args[1]");
|
||||
|
||||
assert.sameValue(log[12].name, "get next done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "get next value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,250 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-async-return.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: execution order for yield* with async iterator and return() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, Symbol.asyncIterator, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
...
|
||||
6. Repeat
|
||||
...
|
||||
c. Else,
|
||||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator, « received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to ? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. If generatorKind is async, then set value to ? Await(value).
|
||||
3. Return Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.
|
||||
ix. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
...
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
[Symbol.asyncIterator]() {
|
||||
var returnCount = 0;
|
||||
return {
|
||||
name: 'asyncIterator',
|
||||
get next() {
|
||||
log.push({ name: "get next" });
|
||||
return function() {
|
||||
return {
|
||||
value: "next-value-1",
|
||||
done: false
|
||||
};
|
||||
};
|
||||
},
|
||||
get return() {
|
||||
log.push({
|
||||
name: "get return",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call return",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
returnCount++;
|
||||
if (returnCount == 1) {
|
||||
return {
|
||||
name: "return-promise-1",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get return then (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call return then (1)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "return-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get return value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "return-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get return done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "return-promise-2",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get return then (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call return then (2)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "return-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get return value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "return-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get return done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
yield* obj;
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next().then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get next");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 2, "log.length");
|
||||
|
||||
iter.return("return-arg-1").then(v => {
|
||||
assert.sameValue(log[2].name, "get return");
|
||||
assert.sameValue(log[2].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[3].name, "call return");
|
||||
assert.sameValue(log[3].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[3].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
|
||||
|
||||
assert.sameValue(log[4].name, "get return then (1)");
|
||||
assert.sameValue(log[4].thisValue.name, "return-promise-1", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[5].name, "call return then (1)");
|
||||
assert.sameValue(log[5].thisValue.name, "return-promise-1", "return then thisValue");
|
||||
assert.sameValue(log[5].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[5].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[5].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[6].name, "get return done (1)");
|
||||
assert.sameValue(log[6].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[7].name, "get return value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[8].name, "get return");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "call return");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "return thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[9].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[10].name, "get return then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "return-promise-2", "get return then thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call return then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "return-promise-2", "return then thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "return then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "return then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "return then args[1]");
|
||||
|
||||
assert.sameValue(log[12].name, "get return done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "get return value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 14, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,258 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-async-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: execution order for yield* with async iterator and throw() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, Symbol.asyncIterator, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
...
|
||||
6. Repeat
|
||||
...
|
||||
b. Else if received.[[Type]] is throw, then
|
||||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to ? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Let resultValue be Return ? IteratorValue(innerResult).
|
||||
b. If generatorKind is async, then set resultValue to ? Await(resultValue).
|
||||
c. Return resultValue.
|
||||
7. If generatorKind is async, then let received be AsyncGeneratorYield(? IteratorValue(innerResult)).
|
||||
...
|
||||
|
||||
AsyncGeneratorYield ( value )
|
||||
|
||||
...
|
||||
8. Return ! AsyncGeneratorResolve(generator, value, false).
|
||||
...
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
[Symbol.asyncIterator]() {
|
||||
var throwCount = 0;
|
||||
return {
|
||||
name: "asyncIterator",
|
||||
get next() {
|
||||
log.push({ name: "get next" });
|
||||
return function() {
|
||||
return {
|
||||
value: "next-value-1",
|
||||
done: false
|
||||
};
|
||||
};
|
||||
},
|
||||
get throw() {
|
||||
log.push({
|
||||
name: "get throw",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call throw",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
throwCount++;
|
||||
if (throwCount == 1) {
|
||||
return {
|
||||
name: "throw-promise-1",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get throw then (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call throw then (1)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "throw-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get throw value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "throw-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get throw done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "throw-promise-2",
|
||||
get then() {
|
||||
log.push({
|
||||
name: "get throw then (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return function(resolve) {
|
||||
log.push({
|
||||
name: "call throw then (2)",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
resolve({
|
||||
name: "throw-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get throw value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "throw-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get throw done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
var v = yield* obj;
|
||||
log.push({
|
||||
name: "after yield*",
|
||||
value: v
|
||||
});
|
||||
return "return-value";
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next().then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get next");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 2, "log.length");
|
||||
|
||||
iter.throw("throw-arg-1").then(v => {
|
||||
assert.sameValue(log[2].name, "get throw");
|
||||
assert.sameValue(log[2].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[3].name, "call throw");
|
||||
assert.sameValue(log[3].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[3].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[4].name, "get throw then (1)");
|
||||
assert.sameValue(log[4].thisValue.name, "throw-promise-1", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[5].name, "call throw then (1)");
|
||||
assert.sameValue(log[5].thisValue.name, "throw-promise-1", "throw thisValue");
|
||||
assert.sameValue(log[5].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[5].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[5].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[6].name, "get throw done (1)");
|
||||
assert.sameValue(log[6].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[7].name, "get throw value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[8].name, "get throw");
|
||||
assert.sameValue(log[8].thisValue.name, "asyncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "call throw");
|
||||
assert.sameValue(log[9].thisValue.name, "asyncIterator", "throw thisValue");
|
||||
assert.sameValue(log[9].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[9].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[10].name, "get throw then (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "throw-promise-2", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "call throw then (2)");
|
||||
assert.sameValue(log[11].thisValue.name, "throw-promise-2", "throw thisValue");
|
||||
assert.sameValue(log[11].args.length, 2, "throw then args.length");
|
||||
assert.sameValue(typeof log[11].args[0], "function", "throw then args[0]");
|
||||
assert.sameValue(typeof log[11].args[1], "function", "throw then args[1]");
|
||||
|
||||
assert.sameValue(log[12].name, "get throw done (2)");
|
||||
assert.sameValue(log[12].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[13].name, "get throw value (2)");
|
||||
assert.sameValue(log[13].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[14].name, "after yield*");
|
||||
assert.sameValue(log[14].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 15, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,69 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-expr-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting yield* operand (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {};
|
||||
var abrupt = function() {
|
||||
throw obj;
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* abrupt();
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, obj, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,89 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
get [Symbol.asyncIterator]() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-not-callable-boolean-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
3. If func is either undefined or null, return undefined.
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-not-callable-number-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
3. If func is either undefined or null, return undefined.
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]: 0
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-not-callable-object-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
3. If func is either undefined or null, return undefined.
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]: {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-not-callable-string-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
3. If func is either undefined or null, return undefined.
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]: ''
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-not-callable-symbol-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
3. If func is either undefined or null, return undefined.
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]: Symbol.asyncIterator
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,94 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-null-sync-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting @@iterator after null @@asyncIterator (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
|
||||
---*/
|
||||
var calls = 0;
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw reason;
|
||||
},
|
||||
get [Symbol.asyncIterator]() {
|
||||
calls += 1;
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, 'reject reason');
|
||||
assert.sameValue(calls, 1);
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while calling [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-boolean-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - boolean (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-null-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - null (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-number-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - number (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-string-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - string (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return '42';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-symbol-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - symbol (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return Symbol.asyncIterator;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-returns-undefined-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.asyncIterator]() - undefined (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
...
|
||||
6. Let iterator be ? Call(method, obj).
|
||||
7. If Type(iterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,94 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-async-undefined-sync-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
|
||||
---*/
|
||||
var calls = 0;
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw reason;
|
||||
},
|
||||
get [Symbol.asyncIterator]() {
|
||||
calls += 1;
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, 'reject reason');
|
||||
assert.sameValue(calls, 1);
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting [Symbol.iterator] (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-not-callable-boolean-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]: false
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-not-callable-number-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]: 0
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-not-callable-object-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]: {}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-not-callable-string-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]: ''
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-not-callable-symbol-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
...
|
||||
|
||||
GetMethod ( V, P )
|
||||
|
||||
...
|
||||
2. Let func be ? GetV(V, P).
|
||||
...
|
||||
4. If IsCallable(func) is false, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]: Symbol.iterator
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,82 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while calling [Symbol.iterator] (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-boolean-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - boolean (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-null-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - null (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-number-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - number (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-string-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - string (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-symbol-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - symbol (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return Symbol.iterator;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-getiter-sync-returns-undefined-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Non object returned by [Symbol.iterator]() - undefined (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
1. Let exprRef be the result of evaluating AssignmentExpression.
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
CreateAsyncFromSyncIterator(syncIterator)
|
||||
|
||||
1. If Type(syncIterator) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-call-done-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting done (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
v. Let done be ? IteratorComplete(innerResult).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
get done() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-call-returns-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while calling next (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,90 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-call-value-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting value (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
vi. If done is true, then
|
||||
1. Return ? IteratorValue(innerResult).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
done: true,
|
||||
get value() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Abrupt completion while getting next (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
get next() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, "reject reason");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,100 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-non-object-ignores-then.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: If next() value is not-object, do not access respective then property (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
|
||||
---*/
|
||||
Number.prototype.then = function() {
|
||||
throw new Test262Error('Number#then should not be used');
|
||||
};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, 'TypeError');
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-boolean-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - boolean (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: true
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-null-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - null (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: null
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-number-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - number (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: 42
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-object-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - object (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: {}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-string-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - string (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-symbol-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - symbol (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: Symbol('oi')
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-not-callable-undefined-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Not-callable next value in a yield star position - undefined (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next: undefined
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v.constructor, TypeError, "TypeError");
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,104 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-get-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Return abrupt after getting next().then (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
10. Get thenAction be then.[[Value]].
|
||||
...
|
||||
12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
|
||||
resolution, thenAction »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
get then() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, 'reject reason');
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-boolean-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (boolean) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: true,
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-null-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (null) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: null,
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-number-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (number) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: 39,
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-object-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (object) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: {},
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-string-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (string) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: '',
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-symbol-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (symbol) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: Symbol('oi'),
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,98 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-non-callable-undefined-fulfillpromise.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: FulfillPromise if next().then is not-callable (undefined) (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
iv. If Type(innerResult) is not Object, throw a TypeError exception.
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
7. If Type(resolution) is not Object, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
11. If IsCallable(thenAction) is false, then
|
||||
a. Return FulfillPromise(promise, resolution).
|
||||
...
|
||||
|
||||
---*/
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then: undefined,
|
||||
value: 42,
|
||||
done: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(({ value, done }) => {
|
||||
assert.sameValue(value, 42);
|
||||
assert.sameValue(done, false);
|
||||
}).then($DONE, $DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,104 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-next-then-returns-abrupt.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: Return abrupt after calling next().then (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, Symbol.asyncIterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
...
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
|
||||
Await
|
||||
|
||||
...
|
||||
2. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||
3. Perform ! Call(promiseCapability.[[Resolve]], undefined, « promise »).
|
||||
...
|
||||
|
||||
Promise Resolve Functions
|
||||
|
||||
...
|
||||
8. Let then be Get(resolution, "then").
|
||||
...
|
||||
10. Get thenAction be then.[[Value]].
|
||||
...
|
||||
12. Perform EnqueueJob("PromiseJobs", PromiseResolveThenableJob, « promise,
|
||||
resolution, thenAction »).
|
||||
...
|
||||
|
||||
---*/
|
||||
var reason = {};
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
throw new Test262Error('it should not get Symbol.iterator');
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return {
|
||||
next() {
|
||||
return {
|
||||
then() {
|
||||
throw reason;
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
yield* obj;
|
||||
throw new Test262Error('abrupt completion closes iter');
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
iter.next().then(() => {
|
||||
throw new Test262Error('Promise incorrectly fulfilled.');
|
||||
}, v => {
|
||||
assert.sameValue(v, reason, 'reject reason');
|
||||
|
||||
iter.next().then(({ done, value }) => {
|
||||
assert.sameValue(done, true, 'the iterator is completed');
|
||||
assert.sameValue(value, undefined, 'value is undefined');
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,237 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-sync-next.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: execution order for yield* with sync iterator and next() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
...
|
||||
2. Let value be ? GetValue(exprRef).
|
||||
3. Let generatorKind be ! GetGeneratorKind().
|
||||
4. Let iterator be ? GetIterator(value, generatorKind).
|
||||
5. Let received be NormalCompletion(undefined).
|
||||
6. Repeat
|
||||
a. If received.[[Type]] is normal, then
|
||||
i. Let innerResult be ? IteratorNext(iterator, received.[[Value]]).
|
||||
ii. Let innerResult be ? Invoke(iterator, "next",
|
||||
« received.[[Value]] »).
|
||||
iii. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
v. Let done be ? IteratorComplete(innerResult).
|
||||
vi. If done is true, then
|
||||
1. Return ? IteratorValue(innerResult).
|
||||
vii. Let received be GeneratorYield(innerResult).
|
||||
...
|
||||
|
||||
GetIterator ( obj [ , hint ] )
|
||||
|
||||
...
|
||||
3. If hint is async,
|
||||
a. Set method to ? GetMethod(obj, @@asyncIterator).
|
||||
b. If method is undefined,
|
||||
i. Let syncMethod be ? GetMethod(obj, @@iterator).
|
||||
ii. Let syncIterator be ? Call(syncMethod, obj).
|
||||
iii. Return ? CreateAsyncFromSyncIterator(syncIterator).
|
||||
...
|
||||
|
||||
%AsyncFromSyncIteratorPrototype%.next ( value )
|
||||
|
||||
...
|
||||
5. Let nextResult be IteratorNext(syncIterator, value).
|
||||
...
|
||||
7. Let nextValue be IteratorValue(nextResult).
|
||||
...
|
||||
9. Let nextDone be IteratorComplete(nextResult).
|
||||
...
|
||||
12. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
|
||||
« nextValue »).
|
||||
...
|
||||
14. Set onFulfilled.[[Done]] to nextDone.
|
||||
15. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
|
||||
onFulfilled, undefined, promiseCapability).
|
||||
...
|
||||
|
||||
Async Iterator Value Unwrap Functions
|
||||
|
||||
1. Return ! CreateIterResultObject(value, F.[[Done]]).
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
get [Symbol.iterator]() {
|
||||
log.push({
|
||||
name: "get [Symbol.iterator]",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call [Symbol.iterator]",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
var nextCount = 0;
|
||||
return {
|
||||
name: "syncIterator",
|
||||
get next() {
|
||||
log.push({
|
||||
name: "get next",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call next",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
nextCount++;
|
||||
if (nextCount == 1) {
|
||||
return {
|
||||
name: "next-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get next value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "next-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get next done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "next-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get next value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "next-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get next done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
},
|
||||
get [Symbol.asyncIterator]() {
|
||||
log.push({ name: "get [Symbol.asyncIterator]" });
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
var v = yield* obj;
|
||||
log.push({
|
||||
name: "after yield*",
|
||||
value: v
|
||||
});
|
||||
return "return-value";
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next("next-arg-1").then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get [Symbol.asyncIterator]");
|
||||
|
||||
assert.sameValue(log[2].name, "get [Symbol.iterator]");
|
||||
assert.sameValue(log[2].thisValue, obj, "get [Symbol.iterator] thisValue");
|
||||
|
||||
assert.sameValue(log[3].name, "call [Symbol.iterator]");
|
||||
assert.sameValue(log[3].thisValue, obj, "[Symbol.iterator] thisValue");
|
||||
assert.sameValue(log[3].args.length, 0, "[Symbol.iterator] args.length");
|
||||
|
||||
assert.sameValue(log[4].name, "get next");
|
||||
assert.sameValue(log[4].thisValue.name, "syncIterator", "get next thisValue");
|
||||
|
||||
assert.sameValue(log[5].name, "call next");
|
||||
assert.sameValue(log[5].thisValue.name, "syncIterator", "next thisValue");
|
||||
assert.sameValue(log[5].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[5].args[0], undefined, "next args[0]");
|
||||
|
||||
assert.sameValue(log[6].name, "get next done (1)");
|
||||
assert.sameValue(log[6].thisValue.name, "next-result-1", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[7].name, "get next value (1)");
|
||||
assert.sameValue(log[7].thisValue.name, "next-result-1", "get next value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 8, "log.length");
|
||||
|
||||
iter.next("next-arg-2").then(v => {
|
||||
assert.sameValue(log[8].name, "call next");
|
||||
assert.sameValue(log[8].thisValue.name, "syncIterator", "next thisValue");
|
||||
assert.sameValue(log[8].args.length, 1, "next args.length");
|
||||
assert.sameValue(log[8].args[0], "next-arg-2", "next args[0]");
|
||||
|
||||
assert.sameValue(log[9].name, "get next done (2)");
|
||||
assert.sameValue(log[9].thisValue.name, "next-result-2", "get next done thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "get next value (2)");
|
||||
assert.sameValue(log[10].thisValue.name, "next-result-2", "get next value thisValue");
|
||||
|
||||
assert.sameValue(log[11].name, "after yield*");
|
||||
assert.sameValue(log[11].value, "next-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 12, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,212 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-sync-return.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: execution order for yield* with sync iterator and return() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, Symbol.asyncIterator, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
...
|
||||
6. Repeat
|
||||
...
|
||||
c. Else,
|
||||
i. Assert: received.[[Type]] is return.
|
||||
ii. Let return be ? GetMethod(iterator, "return").
|
||||
iii. If return is undefined, return Completion(received).
|
||||
iv. Let innerReturnResult be ? Call(return, iterator,
|
||||
« received.[[Value]] »).
|
||||
v. If generatorKind is async, then set innerReturnResult to
|
||||
? Await(innerReturnResult).
|
||||
...
|
||||
vii. Let done be ? IteratorComplete(innerReturnResult).
|
||||
viii. If done is true, then
|
||||
1. Let value be ? IteratorValue(innerReturnResult).
|
||||
2. Return Completion{[[Type]]: return, [[Value]]: value,
|
||||
[[Target]]: empty}.
|
||||
ix. Let received be GeneratorYield(innerResult).
|
||||
|
||||
%AsyncFromSyncIteratorPrototype%.return ( value )
|
||||
|
||||
5. Let return be GetMethod(syncIterator, "return").
|
||||
...
|
||||
...
|
||||
8. Let returnResult be Call(return, syncIterator, « value »).
|
||||
...
|
||||
11. Let returnValue be IteratorValue(returnResult).
|
||||
..
|
||||
13. Let returnDone be IteratorComplete(returnResult).
|
||||
...
|
||||
16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined, « returnValue »).
|
||||
...
|
||||
18. Set onFulfilled.[[Done]] to returnDone.
|
||||
19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
|
||||
onFulfilled, undefined, promiseCapability).
|
||||
...
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
var returnCount = 0;
|
||||
return {
|
||||
name: "syncIterator",
|
||||
get next() {
|
||||
log.push({ name: "get next" });
|
||||
return function() {
|
||||
return {
|
||||
value: "next-value-1",
|
||||
done: false
|
||||
};
|
||||
};
|
||||
},
|
||||
get return() {
|
||||
log.push({
|
||||
name: "get return",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call return",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
returnCount++;
|
||||
if (returnCount == 1) {
|
||||
return {
|
||||
name: "return-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get return value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "return-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get return done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "return-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get return value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "return-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get return done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
yield* obj;
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next().then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get next");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 2, "log.length");
|
||||
|
||||
iter.return("return-arg-1").then(v => {
|
||||
assert.sameValue(log[2].name, "get return");
|
||||
assert.sameValue(log[2].thisValue.name, "syncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[3].name, "call return");
|
||||
assert.sameValue(log[3].thisValue.name, "syncIterator", "return thisValue");
|
||||
assert.sameValue(log[3].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[3].args[0], "return-arg-1", "return args[0]");
|
||||
|
||||
assert.sameValue(log[4].name, "get return done (1)");
|
||||
assert.sameValue(log[4].thisValue.name, "return-result-1", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[5].name, "get return value (1)");
|
||||
assert.sameValue(log[5].thisValue.name, "return-result-1", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 6, "log.length");
|
||||
|
||||
iter.return("return-arg-2").then(v => {
|
||||
assert.sameValue(log[6].name, "get return");
|
||||
assert.sameValue(log[6].thisValue.name, "syncIterator", "get return thisValue");
|
||||
|
||||
assert.sameValue(log[7].name, "call return");
|
||||
assert.sameValue(log[7].thisValue.name, "syncIterator", "get return thisValue");
|
||||
assert.sameValue(log[7].args.length, 1, "return args.length");
|
||||
assert.sameValue(log[7].args[0], "return-arg-2", "return args[0]");
|
||||
|
||||
assert.sameValue(log[8].name, "get return done (2)");
|
||||
assert.sameValue(log[8].thisValue.name, "return-result-2", "get return done thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get return value (2)");
|
||||
assert.sameValue(log[9].thisValue.name, "return-result-2", "get return value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "return-value-2");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 10, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,218 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-star-sync-throw.case
|
||||
// - src/async-generators/default/async-class-expr-static-private-method.template
|
||||
/*---
|
||||
description: execution order for yield* with sync iterator and throw() (Static async generator method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorPrivateMethod
|
||||
features: [Symbol.iterator, async-iteration, class-static-methods-private]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
ClassElement :
|
||||
static PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
YieldExpression: yield * AssignmentExpression
|
||||
|
||||
...
|
||||
6. Repeat
|
||||
...
|
||||
b. Else if received.[[Type]] is throw, then
|
||||
i. Let throw be ? GetMethod(iterator, "throw").
|
||||
ii. If throw is not undefined, then
|
||||
1. Let innerResult be ? Call(throw, iterator, « received.[[Value]] »).
|
||||
2. If generatorKind is async, then set innerResult to
|
||||
? Await(innerResult).
|
||||
...
|
||||
5. Let done be ? IteratorComplete(innerResult).
|
||||
6. If done is true, then
|
||||
a. Return ? IteratorValue(innerResult).
|
||||
7. Let received be GeneratorYield(innerResult).
|
||||
...
|
||||
|
||||
%AsyncFromSyncIteratorPrototype%.throw ( value )
|
||||
|
||||
...
|
||||
5. Let throw be GetMethod(syncIterator, "throw").
|
||||
...
|
||||
8. Let throwResult be Call(throw, syncIterator, « value »).
|
||||
...
|
||||
11. Let throwValue be IteratorValue(throwResult).
|
||||
...
|
||||
13. Let throwDone be IteratorComplete(throwResult).
|
||||
...
|
||||
16. Perform ! Call(valueWrapperCapability.[[Resolve]], undefined,
|
||||
« throwValue »).
|
||||
...
|
||||
18. Set onFulfilled.[[Done]] to throwDone.
|
||||
19. Perform ! PerformPromiseThen(valueWrapperCapability.[[Promise]],
|
||||
onFulfilled, undefined, promiseCapability).
|
||||
...
|
||||
|
||||
---*/
|
||||
var log = [];
|
||||
var obj = {
|
||||
[Symbol.iterator]() {
|
||||
var throwCount = 0;
|
||||
return {
|
||||
name: "syncIterator",
|
||||
get next() {
|
||||
log.push({ name: "get next" });
|
||||
return function() {
|
||||
return {
|
||||
value: "next-value-1",
|
||||
done: false
|
||||
};
|
||||
};
|
||||
},
|
||||
get throw() {
|
||||
log.push({
|
||||
name: "get throw",
|
||||
thisValue: this
|
||||
});
|
||||
return function() {
|
||||
log.push({
|
||||
name: "call throw",
|
||||
thisValue: this,
|
||||
args: [...arguments]
|
||||
});
|
||||
|
||||
throwCount++;
|
||||
if (throwCount == 1) {
|
||||
return {
|
||||
name: "throw-result-1",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get throw value (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return "throw-value-1";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get throw done (1)",
|
||||
thisValue: this
|
||||
});
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
name: "throw-result-2",
|
||||
get value() {
|
||||
log.push({
|
||||
name: "get throw value (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return "throw-value-2";
|
||||
},
|
||||
get done() {
|
||||
log.push({
|
||||
name: "get throw done (2)",
|
||||
thisValue: this
|
||||
});
|
||||
return true;
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
static async *#gen() {
|
||||
callCount += 1;
|
||||
log.push({ name: "before yield*" });
|
||||
var v = yield* obj;
|
||||
log.push({
|
||||
name: "after yield*",
|
||||
value: v
|
||||
});
|
||||
return "return-value";
|
||||
|
||||
}
|
||||
static get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
|
||||
var iter = C.gen();
|
||||
|
||||
assert.sameValue(log.length, 0, "log.length");
|
||||
|
||||
iter.next().then(v => {
|
||||
assert.sameValue(log[0].name, "before yield*");
|
||||
|
||||
assert.sameValue(log[1].name, "get next");
|
||||
|
||||
assert.sameValue(v.value, "next-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 2, "log.length");
|
||||
|
||||
iter.throw("throw-arg-1").then(v => {
|
||||
assert.sameValue(log[2].name, "get throw");
|
||||
assert.sameValue(log[2].thisValue.name, "syncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[3].name, "call throw");
|
||||
assert.sameValue(log[3].thisValue.name, "syncIterator", "throw thisValue");
|
||||
assert.sameValue(log[3].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[3].args[0], "throw-arg-1", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[4].name, "get throw done (1)");
|
||||
assert.sameValue(log[4].thisValue.name, "throw-result-1", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[5].name, "get throw value (1)");
|
||||
assert.sameValue(log[5].thisValue.name, "throw-result-1", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(v.value, "throw-value-1");
|
||||
assert.sameValue(v.done, false);
|
||||
|
||||
assert.sameValue(log.length, 6, "log.length");
|
||||
|
||||
iter.throw("throw-arg-2").then(v => {
|
||||
assert.sameValue(log[6].name, "get throw");
|
||||
assert.sameValue(log[6].thisValue.name, "syncIterator", "get throw thisValue");
|
||||
|
||||
assert.sameValue(log[7].name, "call throw");
|
||||
assert.sameValue(log[7].thisValue.name, "syncIterator", "throw thisValue");
|
||||
assert.sameValue(log[7].args.length, 1, "throw args.length");
|
||||
assert.sameValue(log[7].args[0], "throw-arg-2", "throw args[0]");
|
||||
|
||||
assert.sameValue(log[8].name, "get throw done (2)");
|
||||
assert.sameValue(log[8].thisValue.name, "throw-result-2", "get throw done thisValue");
|
||||
|
||||
assert.sameValue(log[9].name, "get throw value (2)");
|
||||
assert.sameValue(log[9].thisValue.name, "throw-result-2", "get throw value thisValue");
|
||||
|
||||
assert.sameValue(log[10].name, "after yield*");
|
||||
assert.sameValue(log[10].value, "throw-value-2");
|
||||
|
||||
assert.sameValue(v.value, "return-value");
|
||||
assert.sameValue(v.done, true);
|
||||
|
||||
assert.sameValue(log.length, 11, "log.length");
|
||||
}).then($DONE, $DONE);
|
||||
}).catch($DONE);
|
||||
}).catch($DONE);
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-binding-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
var yi\u0065ld;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-binding-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
BindingIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
var yield;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-identifier-reference-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
void yi\u0065ld;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-identifier-reference.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
IdentifierReference : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
void yield;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-label-identifier-escaped.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
yi\u0065ld: ;
|
||||
}};
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-as-label-identifier.case
|
||||
// - src/async-generators/syntax/async-class-expr-private-method.template
|
||||
/*---
|
||||
description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async generator private method as a ClassExpression element)
|
||||
esid: prod-AsyncGeneratorMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * # PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
LabelIdentifier : Identifier
|
||||
|
||||
It is a Syntax Error if this production has a [Yield] parameter and
|
||||
StringValue of Identifier is "yield".
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var C = class { async *#gen() {
|
||||
yield: ;
|
||||
}};
|
@ -0,0 +1,66 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-identifier-spread-strict.case
|
||||
// - src/async-generators/default/async-class-expr-private-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-AsyncGeneratorPrivateMethod
|
||||
features: [object-spread, async-iteration, class-methods-private]
|
||||
flags: [generated, onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
|
||||
Spread Properties
|
||||
|
||||
PropertyDefinition[Yield]:
|
||||
(...)
|
||||
...AssignmentExpression[In, ?Yield]
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
async *#gen() {
|
||||
callCount += 1;
|
||||
return {
|
||||
...(function() {
|
||||
var yield;
|
||||
throw new Test262Error();
|
||||
}()),
|
||||
}
|
||||
}
|
||||
get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
const c = new C();
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||
|
||||
var iter = c.gen();
|
||||
|
||||
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
@ -0,0 +1,57 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/async-generators/yield-identifier-strict.case
|
||||
// - src/async-generators/default/async-class-expr-private-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-AsyncGeneratorPrivateMethod
|
||||
features: [async-iteration, class-methods-private]
|
||||
flags: [generated, onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
ClassElement :
|
||||
PrivateMethodDefinition
|
||||
|
||||
MethodDefinition :
|
||||
AsyncGeneratorMethod
|
||||
|
||||
Async Generator Function Definitions
|
||||
|
||||
AsyncGeneratorMethod :
|
||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||
|
||||
---*/
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
var C = class {
|
||||
async *#gen() {
|
||||
callCount += 1;
|
||||
(function() {
|
||||
var yield;
|
||||
throw new Test262Error();
|
||||
}())
|
||||
}
|
||||
get gen() { return this.#gen; }
|
||||
}
|
||||
|
||||
const c = new C();
|
||||
|
||||
// Test the private fields do not appear as properties before set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||
|
||||
var iter = c.gen();
|
||||
|
||||
|
||||
|
||||
assert.sameValue(callCount, 1);
|
||||
|
||||
// Test the private fields do not appear as properties after set to value
|
||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user