diff options
Diffstat (limited to 'js/src/tests/test262/language/statements/class/elements/async-private-method')
14 files changed, 500 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier-escaped.js new file mode 100644 index 0000000000..d40bf022b2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier-escaped.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + var \u0061wait; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier.js new file mode 100644 index 0000000000..cf96ab3b04 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-binding-identifier.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a binding identifier. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + var await; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference-escaped.js new file mode 100644 index 0000000000..6a0207039f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference-escaped.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + void \u0061wait; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference.js new file mode 100644 index 0000000000..7931167ccd --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-identifier-reference.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + void await; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier-escaped.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier-escaped.js new file mode 100644 index 0000000000..20905576ef --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier-escaped.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + \u0061wait: ; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier.js new file mode 100644 index 0000000000..c6859c2ecc --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/await-as-label-identifier.js @@ -0,0 +1,39 @@ +// |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-private-method.template +/*--- +description: await is a reserved keyword within generator function bodies and may not be used as a label identifier. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + 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 { + async #method() { + await: ; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/browser.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js new file mode 100644 index 0000000000..a40fd874eb --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow-returns-arguments-from-parent-function.js @@ -0,0 +1,45 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + let a = arguments; + return async () => a === arguments; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/returns-async-arrow-returns-newtarget.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js new file mode 100644 index 0000000000..f960ba8e6f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow-returns-newtarget.js @@ -0,0 +1,44 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + return async () => new.target; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/returns-async-arrow.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow.js new file mode 100644 index 0000000000..ee8b999095 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-arrow.js @@ -0,0 +1,44 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + return async () => x; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/returns-async-function-returns-arguments-from-own-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js new file mode 100644 index 0000000000..462ae56bc6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function-returns-arguments-from-own-function.js @@ -0,0 +1,45 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + let a = arguments; + return async function() { return a === arguments; }; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/returns-async-function-returns-newtarget.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function-returns-newtarget.js new file mode 100644 index 0000000000..6046cef1b4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function-returns-newtarget.js @@ -0,0 +1,44 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + return async function() { return new.target; }; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/returns-async-function.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function.js new file mode 100644 index 0000000000..2dc6bce21a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/returns-async-function.js @@ -0,0 +1,44 @@ +// |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-private-method.template +/*--- +description: Async function returns an async function. (Async private method as a ClassDeclaration element) +esid: prod-AsyncMethod +features: [async-functions, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + PrivateMethodDefinition + + MethodDefinition : + AsyncMethod + + Async Function Definitions + + AsyncMethod : + async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + +---*/ +let count = 0; + + +class C { + async #method(x) { + return async function() { return x; }; + } + async method(x) { + return this.#method(x); + } +} +// Stores a reference `asyncFn` for case evaluation +let c = new C(); +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/shell.js b/js/src/tests/test262/language/statements/class/elements/async-private-method/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/async-private-method/shell.js |