summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/class/async-gen-method-static
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/class/async-gen-method-static')
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js68
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js75
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js71
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js38
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js67
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js66
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js138
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js64
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js37
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js46
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js55
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js54
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js51
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js57
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js56
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js59
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js226
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js242
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js250
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js61
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js81
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js77
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js86
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js74
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js79
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js80
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js82
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js72
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js92
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js69
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js90
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js96
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js229
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js204
-rw-r--r--js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js210
107 files changed, 7910 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..18d651813a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/array-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/array-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: ArrayBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method([element]) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..cb0dbc30ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js
new file mode 100644
index 0000000000..e3e77ae799
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..41b8c7147b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void \u0061wait;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js
new file mode 100644
index 0000000000..b23a831929
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void await;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..41a12db02a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ \u0061wait: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js
new file mode 100644
index 0000000000..06d3af15ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/await-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ await: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js
new file mode 100644
index 0000000000..f17f3d275b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-abrupt.js
@@ -0,0 +1,68 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-abrupt.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Abrupt completion returned by evaluation of initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(_ = (function() { throw new Test262Error(); }())) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(Test262Error, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js
new file mode 100644
index 0000000000..2a3a5562f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-not-undefined.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-not-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is not `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+var obj = {};
+var falseCount = 0;
+var stringCount = 0;
+var nanCount = 0;
+var zeroCount = 0;
+var nullCount = 0;
+var objCount = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(aFalse = falseCount +=1, aString = stringCount += 1, aNaN = nanCount += 1, a0 = zeroCount += 1, aNull = nullCount += 1, aObj = objCount +=1) {
+ assert.sameValue(aFalse, false);
+ assert.sameValue(aString, '');
+ assert.sameValue(aNaN, NaN);
+ assert.sameValue(a0, 0);
+ assert.sameValue(aNull, null);
+ assert.sameValue(aObj, obj);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(false, '', NaN, 0, null, obj).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(falseCount, 0, 'initializer not evaluated: false');
+assert.sameValue(stringCount, 0, 'initializer not evaluated: string');
+assert.sameValue(nanCount, 0, 'initializer not evaluated: NaN');
+assert.sameValue(zeroCount, 0, 'initializer not evaluated: 0');
+assert.sameValue(nullCount, 0, 'initializer not evaluated: null');
+assert.sameValue(objCount, 0, 'initializer not evaluated: object');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js
new file mode 100644
index 0000000000..ef1e1a2b32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-arg-val-undefined.js
@@ -0,0 +1,75 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-arg-val-undefined.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Use of initializer when argument value is `undefined` (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ [...]
+ 23. Let iteratorRecord be Record {[[Iterator]]:
+ CreateListIterator(argumentsList), [[Done]]: false}.
+ 24. If hasDuplicates is true, then
+ [...]
+ 25. Else,
+ a. Perform ? IteratorBindingInitialization for formals with
+ iteratorRecord and env as arguments.
+ [...]
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(fromLiteral = 23, fromExpr = 45, fromHole = 99) {
+ assert.sameValue(fromLiteral, 23);
+ assert.sameValue(fromExpr, 45);
+ assert.sameValue(fromHole, 99);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(undefined, void 0).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js
new file mode 100644
index 0000000000..65abb8af33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-duplicates.js
@@ -0,0 +1,67 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-duplicates.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.2 Static Semantics: Early Errors
+
+ StrictFormalParameters : FormalParameters
+
+ - It is a Syntax Error if BoundNames of FormalParameters contains any
+ duplicate elements.
+
+ FormalParameters : FormalParameterList
+
+ - It is a Syntax Error if IsSimpleParameterList of FormalParameterList is
+ false and BoundNames of FormalParameterList contains any duplicate
+ elements.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(x = 0, x) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js
new file mode 100644
index 0000000000..6d665d047a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-later.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-later.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs later in the ParameterList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x = y, y) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js
new file mode 100644
index 0000000000..8e6e10f9e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-prior.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-prior.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter that occurs earlier in the ParameterList (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x, y = x, z = y) {
+ assert.sameValue(x, 3, 'first argument value');
+ assert.sameValue(y, 3, 'second argument value');
+ assert.sameValue(z, 3, 'third argument value');
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(3).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js
new file mode 100644
index 0000000000..740bb85ea7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-ref-self.js
@@ -0,0 +1,69 @@
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-ref-self.case
+// - src/function-forms/error/cls-expr-async-gen-meth-static.template
+/*---
+description: Referencing a parameter from within its own initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.19 Runtime Semantics: IteratorBindingInitialization
+
+ FormalsList : FormalsList , FormalParameter
+
+ 1. Let status be the result of performing IteratorBindingInitialization for
+ FormalsList using iteratorRecord and environment as the arguments.
+ 2. ReturnIfAbrupt(status).
+ 3. Return the result of performing IteratorBindingInitialization for
+ FormalParameter using iteratorRecord and environment as the arguments.
+
+---*/
+var x = 0;
+
+var callCount = 0;
+var C = class {
+ static async *method(x = x) {
+
+ callCount = callCount + 1;
+ }
+};
+
+assert.throws(ReferenceError, function() {
+ C.method();
+});
+assert.sameValue(callCount, 0, 'method body not evaluated');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js
new file mode 100644
index 0000000000..cfd765922b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-rest.js
@@ -0,0 +1,71 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-rest.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: RestParameter does not support an initializer (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [default-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1 Function Definitions
+
+ Syntax
+
+ FunctionRestParameter[Yield] :
+
+ BindingRestElement[?Yield]
+
+ 13.3.3 Destructuring Binding Patterns
+
+ Syntax
+
+ BindingRestElement[Yield] :
+
+ ...BindingIdentifier[?Yield]
+ ...BindingPattern[?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(...x = []) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js
new file mode 100644
index 0000000000..517ec7a733
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/dflt-params-trailing-comma.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/dflt-params-trailing-comma.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using default parameters (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a, b = 39,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, undefined, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
new file mode 100644
index 0000000000..2ec73b6b23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-arguments.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-arguments.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, f.arguments (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ assert.sameValue(this.method.hasOwnProperty("arguments"), false);
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
new file mode 100644
index 0000000000..ece619e5c4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/cls-expr-async-gen-meth-static-forbidden-ext-direct-access-prop-caller.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-direct-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-one/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ ECMAScript function objects defined using syntactic constructors in strict mode code must
+ not be created with own properties named "caller" or "arguments". Such own properties also
+ must not be created for function objects defined using an ArrowFunction, MethodDefinition,
+ GeneratorDeclaration, GeneratorExpression, AsyncGeneratorDeclaration, AsyncGeneratorExpression,
+ ClassDeclaration, ClassExpression, AsyncFunctionDeclaration, AsyncFunctionExpression, or
+ AsyncArrowFunction regardless of whether the definition is contained in strict mode code.
+ Built-in functions, strict functions created using the Function constructor, generator functions
+ created using the Generator constructor, async functions created using the AsyncFunction
+ constructor, and functions created using the bind method also must not be created with such own
+ properties.
+
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ assert.sameValue(this.method.hasOwnProperty("caller"), false);
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b1/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
new file mode 100644
index 0000000000..7c220efb23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-get.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-get.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {get(){return 1}});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
new file mode 100644
index 0000000000..dda9f82e82
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-own-prop-caller-value.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-own-prop-caller-value.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && true) {
+ Object.defineProperty(inner, "caller", {value: 1});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && true) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
new file mode 100644
index 0000000000..81fab0dc85
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/cls-expr-async-gen-meth-static-forbidden-ext-indirect-access-prop-caller.js
@@ -0,0 +1,64 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/forbidden-ext-indirect-access-prop-caller.case
+// - src/function-forms/forbidden-extensions/bullet-two/cls-expr-async-gen-meth-static.template
+/*---
+description: Forbidden extension, o.caller (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [arrow-function, async-functions, async-iteration, class]
+flags: [generated, noStrict, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+
+ If an implementation extends any function object with an own property named "caller" the value of
+ that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function
+ object. If it is an accessor property, the function that is the value of the property's [[Get]]
+ attribute must never return a strict function when called.
+
+---*/
+var CALLER_OWN_PROPERTY_DOES_NOT_EXIST = Symbol();
+function inner() {
+ // This property may exist, but is forbidden from having a value that is a strict function object
+ return inner.hasOwnProperty("caller")
+ ? inner.caller
+ : CALLER_OWN_PROPERTY_DOES_NOT_EXIST;
+}
+
+var callCount = 0;
+var C = class {
+ static async *method() {
+ /* implicit strict */
+ // This and the following conditional value is set in the test's .case file.
+ // For every test that has a "true" value here, there is a
+ // corresponding test that has a "false" value here.
+ // They are generated from two different case files, which use
+ let descriptor = Object.getOwnPropertyDescriptor(inner, "caller");
+ if (descriptor && descriptor.configurable && false) {
+ Object.defineProperty(inner, "caller", {});
+ }
+ var result = inner();
+ if (descriptor && descriptor.configurable && false) {
+ assert.sameValue(result, 1, 'If this test defined an own "caller" property on the inner function, then it should be accessible and should return the value it was set to.');
+ }
+
+ // "CALLER_OWN_PROPERTY_DOES_NOT_EXIST" is from
+ // forbidden-ext-indirect-access-prop-caller.case
+ //
+ // If the function object "inner" has an own property
+ // named "caller", then its value will be returned.
+ //
+ // If the function object "inner" DOES NOT have an
+ // own property named "caller", then the symbol
+ // CALLER_OWN_PROPERTY_DOES_NOT_EXIST will be returned.
+ if (result !== CALLER_OWN_PROPERTY_DOES_NOT_EXIST) {
+ assert.notSameValue(result, this.method);
+ }
+ callCount++;
+ }
+};
+
+C.method().next()
+ .then(() => {
+ assert.sameValue(callCount, 1, 'function body evaluated');
+ }, $DONE).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/b2/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/browser.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/forbidden-ext/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js
new file mode 100644
index 0000000000..2467a34a7f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/object-destructuring-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/object-destructuring-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: ObjectBindingPattern and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 13.3.3.4 Static Semantics: IsSimpleParameterList
+
+ BindingElement : BindingPattern
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method({property}) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js
new file mode 100644
index 0000000000..ca607f5a4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-multiple.js
@@ -0,0 +1,67 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-multiple.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using multiple parameters (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a, b,) {
+ assert.sameValue(a, 42);
+ assert.sameValue(b, 39);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39, 1).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 2, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js
new file mode 100644
index 0000000000..a3b75af329
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/params-trailing-comma-single.js
@@ -0,0 +1,66 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/function-forms/params-trailing-comma-single.case
+// - src/function-forms/default/cls-expr-async-gen-meth-static.template
+/*---
+description: A trailing comma should not increase the respective length, using a single parameter (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] ,
+---*/
+
+var callCount = 0;
+var C = class {
+ static async *method(a,) {
+ assert.sameValue(a, 42);
+ callCount = callCount + 1;
+ }
+}
+
+// Stores a reference `ref` for case evaluation
+var ref = C.method;
+
+ref(42, 39).next().then(() => {
+ assert.sameValue(callCount, 1, 'method invoked exactly once');
+}).then($DONE, $DONE);
+
+assert.sameValue(ref.length, 1, 'length is properly set');
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js
new file mode 100644
index 0000000000..cf706d7220
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-param-strict-body.js
@@ -0,0 +1,138 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-param-strict-body.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: RestParameter and Use Strict Directive are not allowed to coexist for the same function. (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [rest-parameters, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ 14.1.13 Static Semantics: IsSimpleParameterList
+
+ FormalParameters : FormalParameterList , FunctionRestParameter
+
+ 1. Return false.
+
+ 14.1.2 Static Semantics: Early Errors
+
+ FunctionDeclaration : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+ FunctionDeclaration : function ( FormalParameters ) { FunctionBody }
+ FunctionExpression : function BindingIdentifier ( FormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.2.1 Static Semantics: Early Errors
+
+ ArrowFunction : ArrowParameters => ConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of ConciseBody is true and
+ IsSimpleParameterList of ArrowParameters is false.
+
+ 14.3.1 Static Semantics: Early Errors
+
+ MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of FunctionBody is true and
+ IsSimpleParameterList of PropertySetParameterList is false.
+
+ 14.4.1 Static Semantics: Early Errors
+
+ GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ GeneratorDeclaration : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+ GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
+ GeneratorExpression : function * BindingIdentifier ( FormalParameters ) { GeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ 14.5.1 Static Semantics: Early Errors
+
+ AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncGeneratorDeclaration : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorDeclaration : async function * ( FormalParameters ) { AsyncGeneratorBody }
+ AsyncGeneratorExpression : async function * BindingIdentifier ( FormalParameters ) { AsyncGeneratorBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncGeneratorBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.7.1 Static Semantics: Early Errors
+
+ AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of UniqueFormalParameters is false.
+
+ AsyncFunctionDeclaration : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionDeclaration : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function ( FormalParameters ) { AsyncFunctionBody }
+ AsyncFunctionExpression : async function BindingIdentifier ( FormalParameters ) { AsyncFunctionBody }
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncFunctionBody is true and
+ IsSimpleParameterList of FormalParameters is false.
+
+ 14.8.1 Static Semantics: Early Errors
+
+ AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead => AsyncConciseBody
+
+ - It is a Syntax Error if ContainsUseStrict of AsyncConciseBody is true and
+ IsSimpleParameterList of CoverCallExpressionAndAsyncArrowHead is false.
+
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(a,...rest) {
+ "use strict";
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js
new file mode 100644
index 0000000000..e71309571f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/rest-params-trailing-comma-early-error.js
@@ -0,0 +1,64 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/function-forms/rest-params-trailing-comma-early-error.case
+// - src/function-forms/syntax/cls-expr-async-gen-meth-static.template
+/*---
+description: It's a syntax error if a FunctionRestParameter is followed by a trailing comma (static class expression async generator method)
+esid: sec-class-definitions-runtime-semantics-evaluation
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassExpression : class BindingIdentifieropt ClassTail
+
+ 1. If BindingIdentifieropt is not present, let className be undefined.
+ 2. Else, let className be StringValue of BindingIdentifier.
+ 3. Let value be the result of ClassDefinitionEvaluation of ClassTail
+ with argument className.
+ [...]
+
+ 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
+
+ 21. For each ClassElement m in order from methods
+ a. If IsStatic of m is false, then
+ b. Else,
+ Let status be the result of performing PropertyDefinitionEvaluation
+ for m with arguments F and false.
+ [...]
+
+ Runtime Semantics: PropertyDefinitionEvaluation
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters )
+ { AsyncGeneratorBody }
+
+ 1. Let propKey be the result of evaluating PropertyName.
+ 2. ReturnIfAbrupt(propKey).
+ 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true.
+ Otherwise let strict be false.
+ 4. Let scope be the running execution context's LexicalEnvironment.
+ 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters,
+ AsyncGeneratorBody, scope, strict).
+ [...]
+
+
+ Trailing comma in the parameters list
+
+ 14.1 Function Definitions
+
+ FormalParameters[Yield, Await] :
+ [empty]
+ FunctionRestParameter[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await]
+ FormalParameterList[?Yield, ?Await] ,
+ FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await]
+---*/
+$DONOTEVALUATE();
+
+0, class {
+ static async *method(...a,) {
+
+ }
+};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/shell.js
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js
new file mode 100644
index 0000000000..848d6e2303
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js
new file mode 100644
index 0000000000..675f2b0765
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-binding-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ var yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js
new file mode 100644
index 0000000000..985f0c11aa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void yi\u0065ld;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js
new file mode 100644
index 0000000000..20327d4b46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-identifier-reference.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ void yield;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js
new file mode 100644
index 0000000000..3e5569fd45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier-escaped.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ yi\u0065ld: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js
new file mode 100644
index 0000000000..c73d866f7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-as-label-identifier.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// 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-method.template
+/*---
+description: yield is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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".
+
+---*/
+$DONOTEVALUATE();
+
+
+var C = class { static async *gen() {
+ yield: ;
+}};
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js
new file mode 100644
index 0000000000..2915340212
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-spread-strict-strict.js
@@ -0,0 +1,55 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-spread-strict.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ return {
+ ...(function() {
+ var yield;
+ throw new Test262Error();
+ }()),
+ }
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js
new file mode 100644
index 0000000000..2fd9c7eeae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-identifier-strict-strict.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-identifier-strict.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+---*/
+$DONOTEVALUATE();
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ (function() {
+ var yield;
+ throw new Test262Error();
+ }())
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js
new file mode 100644
index 0000000000..5c1e7f40ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-catch.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
new file mode 100644
index 0000000000..0ddf0f91eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-async-iterator.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: yield * [Promise.reject(value)] is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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;
+ }
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
new file mode 100644
index 0000000000..ba8aa62ef4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-for-await-of-sync-iterator.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// 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-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-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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;
+ }
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js
new file mode 100644
index 0000000000..f15658c275
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-async-iterator.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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();
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
new file mode 100644
index 0000000000..ca4525ad9e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next-yield-star-sync-iterator.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: yield * (async iterator) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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;
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js
new file mode 100644
index 0000000000..c27d2c7d36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-promise-reject-next.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: yield Promise.reject(value) is treated as throw value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js
new file mode 100644
index 0000000000..f367ee6910
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-multiple.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-multiple.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+includes: [compareArray.js]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+var item;
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield [...yield yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+item = iter.next(['a', 'b', 'c']);
+
+item.then(({ done, value }) => {
+ item = iter.next(value);
+
+ item.then(({ done, value }) => {
+ assert(compareArray(value, arr));
+ assert.sameValue(done, false);
+ }).then($DONE, $DONE);
+}).catch($DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js
new file mode 100644
index 0000000000..f0559193f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-arr-single.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-arr-single.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a array spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Array Initializer
+
+ SpreadElement[Yield, Await]:
+ ...AssignmentExpression[+In, ?Yield, ?Await]
+
+---*/
+var arr = ['a', 'b', 'c'];
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield [...yield];
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next(false);
+var item = iter.next(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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js
new file mode 100644
index 0000000000..73e7b5d674
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-spread-obj.js
@@ -0,0 +1,59 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/async-generators/yield-spread-obj.case
+// - src/async-generators/default/async-class-expr-static-method.template
+/*---
+description: Use yield value in a object spread position (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [object-spread, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ MethodDefinition :
+ AsyncGeneratorMethod
+
+ Async Generator Function Definitions
+
+ AsyncGeneratorMethod :
+ async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
+
+
+ Spread Properties
+
+ PropertyDefinition[Yield]:
+ (...)
+ ...AssignmentExpression[In, ?Yield]
+
+---*/
+
+
+var callCount = 0;
+
+var C = class { static async *gen() {
+ callCount += 1;
+ yield {
+ ...yield,
+ y: 1,
+ ...yield yield,
+ };
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next();
+iter.next({ x: 42 });
+iter.next({ x: 'lol' });
+var item = iter.next({ y: 39 });
+
+item.then(({ done, value }) => {
+ assert.sameValue(value.x, 42);
+ assert.sameValue(value.y, 39);
+ assert.sameValue(Object.keys(value).length, 2);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js
new file mode 100644
index 0000000000..77006a1cce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-next.js
@@ -0,0 +1,226 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Execution order for yield* with async iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js
new file mode 100644
index 0000000000..2516c2a72e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-return.js
@@ -0,0 +1,242 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: execution order for yield* with async iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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;
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js
new file mode 100644
index 0000000000..0d6cdc421e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-async-throw.js
@@ -0,0 +1,250 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: execution order for yield* with async iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js
new file mode 100644
index 0000000000..ab36902e14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-expr-abrupt.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting yield* operand (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js
new file mode 100644
index 0000000000..8423d139da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-get-abrupt.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..0bea4fb881
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-boolean-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js
new file mode 100644
index 0000000000..d639f47d22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-number-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js
new file mode 100644
index 0000000000..70dd974ccb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-object-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js
new file mode 100644
index 0000000000..c929f3f8ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-string-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..50c5f612ec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-not-callable-symbol-throw.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.asyncIterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
new file mode 100644
index 0000000000..f9e4844ad7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-null-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting @@iterator after null @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js
new file mode 100644
index 0000000000..dc07a3ab87
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-abrupt.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while calling [Symbol.asyncIterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js
new file mode 100644
index 0000000000..1a595bfff9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-boolean-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js
new file mode 100644
index 0000000000..a0e258e425
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-null-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js
new file mode 100644
index 0000000000..5f1e760494
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-number-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js
new file mode 100644
index 0000000000..8b72208062
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-string-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js
new file mode 100644
index 0000000000..ccd4dd4443
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-symbol-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js
new file mode 100644
index 0000000000..9454e665eb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-returns-undefined-throw.js
@@ -0,0 +1,77 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.asyncIterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
new file mode 100644
index 0000000000..8c361b1ede
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-async-undefined-sync-get-abrupt.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting @@iterator after undefined @@asyncIterator (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js
new file mode 100644
index 0000000000..c4db55c988
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..2f35228833
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js
new file mode 100644
index 0000000000..87ce580b29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js
new file mode 100644
index 0000000000..05bd91d537
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-object-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js
new file mode 100644
index 0000000000..c79a527bdf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..944bd7b03b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-not-callable-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Throws a TypeError on a non-callable [Symbol.iterator] (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js
new file mode 100644
index 0000000000..7b1224fcb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-abrupt.js
@@ -0,0 +1,74 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while calling [Symbol.iterator] (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js
new file mode 100644
index 0000000000..dcc5671a33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-boolean-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js
new file mode 100644
index 0000000000..15a42cb2f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-null-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js
new file mode 100644
index 0000000000..95b9e5b0fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-number-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js
new file mode 100644
index 0000000000..ab2651614a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-string-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js
new file mode 100644
index 0000000000..e9398720b8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-symbol-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js
new file mode 100644
index 0000000000..d2a4b81361
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-getiter-sync-returns-undefined-throw.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Non object returned by [Symbol.iterator]() - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
new file mode 100644
index 0000000000..0ecfce6ee1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting done (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
new file mode 100644
index 0000000000..34327e9c8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while calling next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js
new file mode 100644
index 0000000000..12bcdc3a53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-call-value-get-abrupt.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting value (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js
new file mode 100644
index 0000000000..cbfd49c469
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-get-abrupt.js
@@ -0,0 +1,72 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Abrupt completion while getting next (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
new file mode 100644
index 0000000000..d3b19be4ef
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
@@ -0,0 +1,92 @@
+// |reftest| async
+// 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-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-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js
new file mode 100644
index 0000000000..0debc00d3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-boolean-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - boolean (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js
new file mode 100644
index 0000000000..d4fa526281
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-null-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - null (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js
new file mode 100644
index 0000000000..9534329e08
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-number-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - number (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js
new file mode 100644
index 0000000000..f8f3f30d4a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-object-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - object (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js
new file mode 100644
index 0000000000..cd023a3cb3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-string-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - string (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js
new file mode 100644
index 0000000000..8b32699f31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-symbol-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - symbol (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js
new file mode 100644
index 0000000000..7ac924904b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-not-callable-undefined-throw.js
@@ -0,0 +1,69 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Not-callable next value in a yield star position - undefined (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
new file mode 100644
index 0000000000..b2ff498c30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Return abrupt after getting next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
new file mode 100644
index 0000000000..37ad663120
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-boolean-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (boolean) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
new file mode 100644
index 0000000000..13d0bea58f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-null-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (null) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
new file mode 100644
index 0000000000..cf43777058
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-number-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (number) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
new file mode 100644
index 0000000000..9ae9c7c066
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-object-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (object) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
new file mode 100644
index 0000000000..b2698f6372
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-string-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (string) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
new file mode 100644
index 0000000000..9a207839b3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-symbol-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (symbol) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
new file mode 100644
index 0000000000..233e347afe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-non-callable-undefined-fulfillpromise.js
@@ -0,0 +1,90 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: FulfillPromise if next().then is not-callable (undefined) (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = gen();
+
+iter.next().then(({ value, done }) => {
+ assert.sameValue(value, 42);
+ assert.sameValue(done, false);
+}).then($DONE, $DONE);
+
+assert.sameValue(callCount, 1);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js
new file mode 100644
index 0000000000..1f779ab5d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-next-then-returns-abrupt.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: Return abrupt after calling next().then (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, Symbol.asyncIterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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');
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js
new file mode 100644
index 0000000000..81133c9bf8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-next.js
@@ -0,0 +1,229 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: execution order for yield* with sync iterator and next() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+
+}}
+
+var gen = C.gen;
+
+var iter = 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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js
new file mode 100644
index 0000000000..4d531aa88b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-return.js
@@ -0,0 +1,204 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: execution order for yield* with sync iterator and return() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration, Symbol.asyncIterator]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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;
+
+}}
+
+var gen = C.gen;
+
+var iter = 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().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], undefined, "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);
diff --git a/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js
new file mode 100644
index 0000000000..14af8af227
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/class/async-gen-method-static/yield-star-sync-throw.js
@@ -0,0 +1,210 @@
+// |reftest| async
+// 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-method.template
+/*---
+description: execution order for yield* with sync iterator and throw() (Static async generator method as a ClassExpression element)
+esid: prod-AsyncGeneratorMethod
+features: [Symbol.iterator, async-iteration]
+flags: [generated, async]
+info: |
+ ClassElement :
+ static MethodDefinition
+
+ 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";
+
+}}
+
+var gen = C.gen;
+
+var iter = 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().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], undefined, "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);