diff options
Diffstat (limited to 'js/src/tests/test262/language/statements/class/elements/async-private-method-static')
14 files changed, 506 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js new file mode 100644 index 0000000000..65094a194e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier-escaped.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-binding-identifier-escaped.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + BindingIdentifier : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + var \u0061wait; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier.js new file mode 100644 index 0000000000..03633af3f5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-binding-identifier.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-binding-identifier.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + BindingIdentifier : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + var await; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js new file mode 100644 index 0000000000..9497de6af9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference-escaped.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-identifier-reference-escaped.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + IdentifierReference : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + void \u0061wait; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference.js new file mode 100644 index 0000000000..186b301db2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-identifier-reference.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-identifier-reference.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + IdentifierReference : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + void await; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier-escaped.js new file mode 100644 index 0000000000..79c9a46179 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier-escaped.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-label-identifier-escaped.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + LabelIdentifier : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + \u0061wait: ; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier.js new file mode 100644 index 0000000000..d0493a7bac --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/await-as-label-identifier.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/async-functions/await-as-label-identifier.case +// - src/async-functions/syntax/async-class-decl-static-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + + LabelIdentifier : Identifier + + It is a Syntax Error if this production has a [Await] parameter and + StringValue of Identifier is "await". + +---*/ +$DONOTEVALUATE(); + + +class C { + static async #method() { + await: ; + } +} + + diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/browser.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js new file mode 100644 index 0000000000..8fceeed5d1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-arguments-from-parent-function.js @@ -0,0 +1,44 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-arrow-returns-arguments-from-parent-function.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + let a = arguments; + return async () => a === arguments; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn().then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, true); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js new file mode 100644 index 0000000000..3946ffd23a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow-returns-newtarget.js @@ -0,0 +1,43 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-arrow-returns-newtarget.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + return async () => new.target; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn().then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, undefined); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow.js new file mode 100644 index 0000000000..ae1ac57bf9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-arrow.js @@ -0,0 +1,43 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-arrow.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + return async () => x; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn(1).then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, 1); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js new file mode 100644 index 0000000000..692da97eee --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-arguments-from-own-function.js @@ -0,0 +1,44 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-function-returns-arguments-from-own-function.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + let a = arguments; + return async function() { return a === arguments; }; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn(1).then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, false); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js new file mode 100644 index 0000000000..0b2351911d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function-returns-newtarget.js @@ -0,0 +1,43 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-function-returns-newtarget.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + return async function() { return new.target; }; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn(1).then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, undefined); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function.js new file mode 100644 index 0000000000..8bdec77ce3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/returns-async-function.js @@ -0,0 +1,43 @@ +// |reftest| async +// This file was procedurally generated from the following sources: +// - src/async-functions/returns-async-function.case +// - src/async-functions/evaluation/async-class-decl-static-private-method.template +/*--- +description: Async function returns an async function. (Static async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-static-methods-private] +flags: [generated, async] +info: | + ClassElement : + static PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + static async #method(x) { + return async function() { return x; }; + } + static async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let asyncFn = C.method.bind(C); + +asyncFn(1).then(retFn => { + count++; + return retFn(); +}).then(result => { + assert.sameValue(result, 1); + assert.sameValue(count, 1); +}).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method-static/shell.js b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method-static/shell.js |