diff options
Diffstat (limited to 'js/src/tests/test262/language/statements/class/elements/syntax')
260 files changed, 9910 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/browser.js b/js/src/tests/test262/language/statements/class/elements/syntax/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/browser.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js new file mode 100644 index 0000000000..725572fa81 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-arrow-heritage.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/class-heritage-array-literal-arrow-heritage.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassTail : ClassHeritage { ClassBody } + + ClassHeritage : + extends LeftHandSideExpression + +---*/ + + +$DONOTEVALUATE(); + +class C extends () => {} { + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js new file mode 100644 index 0000000000..64b65965ed --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/class-heritage-array-literal-async-arrow-heritage.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/class-heritage-array-literal-async-arrow-heritage.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassTail : ClassHeritage { ClassBody } + + ClassHeritage : + extends LeftHandSideExpression + +---*/ + + +$DONOTEVALUATE(); + +class C extends async () => {} { + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/browser.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..048f87ae90 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..f1e82d4242 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..c01c57926d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..b1680d7470 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-async.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..8bc33c89ba --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..792f66b899 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-method.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..3a2f9fc0ec --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#m); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..adcb626c91 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-call-expression-privatename.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete (g().#x); + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..d95a5b6e45 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..76c28d6d14 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..6716eb230d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..6e0de9f02e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-async.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..34b4efadd9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..2cfddf0c62 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-method.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m +); + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..0b939313b7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#m); + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..c532a4fa2d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-covered-err-delete-member-expression-privatename.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete (this.#x); + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..375e2833c8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..b339bee24d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..4d5768d06f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..65f6b800af --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-async.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..e06dbede59 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..8de8b86e6e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-method.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..a4b681b2c0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#m; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..23398a4b22 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-call-expression-privatename.js @@ -0,0 +1,39 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete g().#x; + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..ff62273759 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..443d044fe8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..957c608694 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..9d3045d1fe --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-async.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..841b0e7a85 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..75017d0272 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-method.js @@ -0,0 +1,38 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m +; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..b36c9bfe9d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,37 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#m; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..f2abd8f4df --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-err-delete-member-expression-privatename.js @@ -0,0 +1,37 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete this.#x; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..b4cc315b32 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..439cc8f1b3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..af61de31e4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..793a100152 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-async.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..221b83ffa4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..52f0c2e2bb --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-method.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..4ef6ac94fa --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#m)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..5bcb6fb949 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-call-expression-privatename.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + g = this.f; + x = delete ((g().#x)); + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..eaeb4e0774 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..4db71f1625 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..ef92e690b5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..22ad4c627c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-async.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..f2fce899b8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..eaffab2464 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-method.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m +)); + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..a8c4055cb7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#m)); + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..e8279b2f45 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/field-delete-twice-covered-err-delete-member-expression-privatename.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-field-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in field, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x = delete ((this.#x)); + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..2c5e260919 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..851b778f9e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..8c8f1c8757 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..cb2f115354 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-async.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..a43392bdfa --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..e72c2385fc --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-method.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..6d0fba7c35 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#m); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..be6e92d1f8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-call-expression-privatename.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete (g().#x); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..64dc052956 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..d9459ce491 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..21a539de83 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..a5094182f6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-async.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..9b60741fed --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..dcb09ae291 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-method.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m +); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..ef2bbcd031 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,47 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#m); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..07c1c079c6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-covered-err-delete-member-expression-privatename.js @@ -0,0 +1,47 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method, covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete (this.#x); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..53d75c453b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..6f2aa7fd92 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..7e393a5f54 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..d9e120e502 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-async.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..93c7464d97 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..c42ec89007 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-method.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..195ace594a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#m; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..3b157abf71 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-call-expression-privatename.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete g().#x; + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..145d32372d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..478d90b58e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..ed9a763511 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..235ef7cafe --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-async.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..2fef15be78 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..baf9e90077 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-method.js @@ -0,0 +1,42 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m +; + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..eb8974ebbd --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#m; + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..452281c26f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-err-delete-member-expression-privatename.js @@ -0,0 +1,41 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete this.#x; + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..92d223ff91 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-get.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor get method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class-fields-public, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..8ff0ddbe26 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-accessor-set.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName accessor set method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private, class-methods-private, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js new file mode 100644 index 0000000000..3416671362 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async-gen.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async generator (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js new file mode 100644 index 0000000000..159cc68a91 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-async.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName async method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js new file mode 100644 index 0000000000..7b67503b9c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method-gen.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName generator (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js new file mode 100644 index 0000000000..e42ca69e69 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-method.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private ordinary method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js new file mode 100644 index 0000000000..894e6dec11 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-private-no-reference.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName no referencing class element (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#m)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js new file mode 100644 index 0000000000..3369ed7036 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-call-expression-privatename.js @@ -0,0 +1,49 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-call-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to CallExpression.PrivateName private field (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + var g = this.f; + delete ((g().#x)); + } + + f() { + return this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js new file mode 100644 index 0000000000..f2d177b212 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-get.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-get.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor get method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js new file mode 100644 index 0000000000..5dc1a2ce6b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-accessor-set.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-accessor-set.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName accessor set method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js new file mode 100644 index 0000000000..587b65efaa --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async-gen.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async generator (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-iteration, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + async *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js new file mode 100644 index 0000000000..f76f8015b9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-async.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-async.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName async method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, async-functions, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js new file mode 100644 index 0000000000..573901042b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method-gen.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method-gen.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName generator (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, generators, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + *#m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js new file mode 100644 index 0000000000..e5467a13e3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-method.js @@ -0,0 +1,48 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-method.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private ordinary method (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-methods-private, class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m +)); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js new file mode 100644 index 0000000000..568d177eaf --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-private-no-reference.js @@ -0,0 +1,47 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-private-no-reference.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName no referencing class element (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#m)); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js new file mode 100644 index 0000000000..60ba271d21 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/method-delete-twice-covered-err-delete-member-expression-privatename.js @@ -0,0 +1,47 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/err-delete-member-expression-privatename.case +// - src/class-elements/delete-error/cls-decl-method-delete-twice-covered.template +/*--- +description: It's a SyntaxError if delete operator is applied to MemberExpression.PrivateName private field (in method, recursively covered) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + This file must never use the onlyStrict flag as the strict mode should always + be observed inside class bodies. + + Static Semantics: Early Errors + + UnaryExpression : delete UnaryExpression + + It is a Syntax Error if the UnaryExpression is contained in strict mode + code and the derived UnaryExpression is + PrimaryExpression : IdentifierReference , + MemberExpression : MemberExpression.PrivateName , or + CallExpression : CallExpression.PrivateName . + + It is a Syntax Error if the derived UnaryExpression is + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList and + CoverParenthesizedExpressionAndArrowParameterList ultimately derives a + phrase that, if used in place of UnaryExpression, would produce a + Syntax Error according to these rules. This rule is recursively applied. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + x() { + + delete ((this.#x)); + } + + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/shell.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/delete/shell.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js new file mode 100644 index 0000000000..db30575dd6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-class-body-ctor-duplicate.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-class-body-ctor-duplicate.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It is a SyntaxError if the class body has more than one constructor (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassBody : ClassElementList + It is a Syntax Error if PrototypePropertyNameList of ClassElementList contains more + than one occurrence of "constructor". + +---*/ + + +$DONOTEVALUATE(); + +class C { + constructor() {} + constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js new file mode 100644 index 0000000000..70fbce6ef2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-ctor-super-no-heritage.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-ctor-super-no-heritage.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It is a SyntaxError if class has no heritage and constructor has a direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassTail : ClassHeritageopt { ClassBody } + + It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true: + 1. Let constructor be ConstructorMethod of ClassBody. + 2. If constructor is empty, return false. + 3. Return HasDirectSuper of constructor. + +---*/ + + +$DONOTEVALUATE(); + +class C { + constructor() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js new file mode 100644 index 0000000000..8da16c9904 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-ues-error.js @@ -0,0 +1,71 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-identifier-invalid-ues-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u0000; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..6b445d097d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwj-error.js @@ -0,0 +1,71 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-identifier-invalid-zwj-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u200D_ZWJ; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..da49b2eddb --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-field-identifier-invalid-zwnj-error.js @@ -0,0 +1,71 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-identifier-invalid-zwnj-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u200C_ZWNJ; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-fields-same-line-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-fields-same-line-error.js new file mode 100644 index 0000000000..be7608def1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-fields-same-line-error.js @@ -0,0 +1,34 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-fields-same-line-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +$DONOTEVALUATE(); + +class C { + x y +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js new file mode 100644 index 0000000000..de14f96cd7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-array-literal.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage-array-literal.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if an array literal evaluated on ClassHeritage uses a private name. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends (o) => [o.#foo] +{ + #foo; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js new file mode 100644 index 0000000000..94986520f9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage-chained-usage.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class expression evaluated on ClassHeritage uses an private name declared on subclass. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends class extends class extends class { x = this.#foo; } { #foo; x = this.#bar; } { #bar; x = this.#fuz; } +{ + #fuz; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js new file mode 100644 index 0000000000..2d65e00933 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-function-expression.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage-function-expression.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a function expression evaluated on ClassHeritage uses a private name. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends function() { x = this.#foo; } +{ + #foo; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js new file mode 100644 index 0000000000..014716a774 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-obj-literal.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage-obj-literal.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a object literal evaluated on ClassHeritage uses a private name. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends (o) => {x: o.#foo} +{ + #foo; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js new file mode 100644 index 0000000000..0b8435a1a0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage-recursive.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class expression evaluated on ClassHeritage of a ClassHeritage uses an undeclared private name. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends class extends class { x = this.#foo; } {} +{ + #foo; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js new file mode 100644 index 0000000000..b981b75d32 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-environment-on-class-heritage.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class expression evaluated on ClassHeritage uses an undeclared private name. (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage { ClassBody } + ... + 5. Let outerPrivateEnvironment be the PrivateEnvironment of the running execution context. + 6. Let classPrivateEnvironment be NewDeclarativeEnvironment(outerPrivateEnvironment). + 7. Let classPrivateEnvRec be classPrivateEnvironment's EnvironmentRecord. + 8. If ClassBodyopt is present, then + a. For each element dn of the PrivateBoundIdentifiers of ClassBodyopt, + i. Perform classPrivateEnvRec.CreateImmutableBinding(dn, true). + 9. If ClassHeritageopt is not present, then + a. Let protoParent be the intrinsic object %ObjectPrototype%. + b. Let constructorParent be the intrinsic object %FunctionPrototype%. + 10. Else, + a. Set the running execution context's LexicalEnvironment to classScope. + b. NOTE: The running execution context's PrivateEnvironment is outerPrivateEnvironment when evaluating ClassHeritage. + ... + +---*/ + + +$DONOTEVALUATE(); + +class C extends class { x = this.#foo; } +{ + #foo; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js new file mode 100644 index 0000000000..8254217109 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js @@ -0,0 +1,33 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-field-on-object-destructuring.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Acessing private field from object destructuring pattern is not a valid syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, destructuring-binding, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ObjectAssignmentPattern[Yield, Await]: + {} + {AssignmentRestProperty[?Yield, ?Await]} + {AssignmentPropertyList[?Yield, ?Await]} + {AssignmentPropertyList[?Yield, ?Await],AssignmentRestProperty[?Yield, ?Await]opt} + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x = 1; + + destructureX() { + const { #x: x } = this; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-super-access.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-super-access.js new file mode 100644 index 0000000000..e690edec34 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-super-access.js @@ -0,0 +1,36 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-private-field-super-access.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Acessing private field from super is not a valid syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + MemberExpression[Yield]: + MemberExpression[?Yield].PrivateName + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m = function() { return 'test262'; }; + + Child = class extends C { + access() { + return super.#m; + } + + method() { + return super.#m(); + } + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js new file mode 100644 index 0000000000..2e03782e03 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-async-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private async generator and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + async * #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js new file mode 100644 index 0000000000..17162a0fa1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-async.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private async function and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + async #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js new file mode 100644 index 0000000000..446d1695c8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private generator and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + * #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js new file mode 100644 index 0000000000..a8f957f57a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-get-field.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private getter and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + get #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js new file mode 100644 index 0000000000..e9267a0cb9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-get-get.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains multiple private getters with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + get #m() {} + get #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js new file mode 100644 index 0000000000..063ae79cf2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-field.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private method and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js new file mode 100644 index 0000000000..e7ceedf914 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-get.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private method and a private getter with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + get #m() {} + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js new file mode 100644 index 0000000000..9b67e895f7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains multiple private methods with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m() {} + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js new file mode 100644 index 0000000000..732c8f0717 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-set.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private method and a private setter with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + set #m(_) {} + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js new file mode 100644 index 0000000000..2a4f444bb7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private method and a private static field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-static-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + static #m; + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js new file mode 100644 index 0000000000..c505a7eac5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-staticmeth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private method and a private static method with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + static #m() {} + #m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js new file mode 100644 index 0000000000..42710bd0d7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-set-field.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains a private setter and a private field with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + #m; + set #m(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js new file mode 100644 index 0000000000..209cf3c7be --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js @@ -0,0 +1,27 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-set-set.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It's a SyntaxError if a class contains multiple private setters with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +$DONOTEVALUATE(); + +class C { + set #m(_) {} + set #m(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-constructor.js new file mode 100644 index 0000000000..2662c8dc9a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Private Fields cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + #constructor +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-error.js new file mode 100644 index 0000000000..1dd4589a4a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-error.js @@ -0,0 +1,37 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigial and IdentifierName (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + # x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js new file mode 100644 index 0000000000..a30cc3819d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-ues.js @@ -0,0 +1,65 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-identifier-invalid-ues.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + #\u0000; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..03d1346bc9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwj-error.js @@ -0,0 +1,66 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-identifier-invalid-zwj-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + #\u200D_ZWJ; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..d08d92b990 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-identifier-invalid-zwnj-error.js @@ -0,0 +1,66 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-identifier-invalid-zwnj-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +$DONOTEVALUATE(); + +class C { + #\u200C_ZWNJ; + +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js new file mode 100644 index 0000000000..ea4682b234 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js @@ -0,0 +1,53 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-in-computed-property-missing.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Use of undeclared PrivateName in ComputedProperty is a syntax error (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class-fields-public, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElementName: + PropertyName + PrivateIdentifier + + PropertyName: + LiteralPropertyName + ComputedPropertyName + + ComputedPropertyName: + [ AssignmentExpression ] + + AssignmentExpression ... MemberExpression + + MemberExpression: + MemberExpression . PrivateName + + Static Semantics: AllPrivateIdentifiersValid + AllPrivateIdentifiersValid is an abstract operation which takes names as an argument. + + MemberExpression : MemberExpression . PrivateIdentifier + 1. If StringValue of PrivateIdentifier is in names, return true. + 2. Return false. + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundIdentifiers of ClassBody. + 2. Return AllPrivateIdentifiersValid of ClassElementList with the argument newNames. + + Static Semantics: Early Errors + + ScriptBody : StatementList + It is a Syntax Error if AllPrivateIdentifiersValid of StatementList with an empty List as an argument is false unless the source code is eval code that is being processed by a direct eval. + +---*/ + + +$DONOTEVALUATE(); + +class C { + [this.#f] = 'Test262' +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js new file mode 100644 index 0000000000..cff10054a3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-get-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-accessor-get-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName () (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + get # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js new file mode 100644 index 0000000000..0868afc3c9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-accessor-set-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-accessor-set-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Accessor set Method) (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + set # m(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js new file mode 100644 index 0000000000..0eb87b2265 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-gen-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-async-gen-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Async Generator Method) (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + async * # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js new file mode 100644 index 0000000000..4faf4f22df --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-async-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-async-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Async Method) (class declaration) +esid: prod-ClassElement +features: [async-functions, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + async # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js new file mode 100644 index 0000000000..a458dfd915 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-call-expr.js @@ -0,0 +1,40 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-call-expr.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (CallExpression) (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + + f() { + return this; + } + + m() { + this.f().# x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js new file mode 100644 index 0000000000..4dc6ea1095 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field-init.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-field-init.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Field with Initializer) (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + # x = 1; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js new file mode 100644 index 0000000000..ca62d39397 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-field.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-field.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Field) (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + # x; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js new file mode 100644 index 0000000000..d16e23ef6f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-gen-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-gen-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Generator Method) (class declaration) +esid: prod-ClassElement +features: [generators, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + * # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js new file mode 100644 index 0000000000..34dd6ab17d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-member-expr.js @@ -0,0 +1,35 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-member-expr.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (MemberExpression) (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x; + m() { + this.# x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js new file mode 100644 index 0000000000..b43126fdf4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-meth.case.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-meth.case.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Method) (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js new file mode 100644 index 0000000000..baf73f5c4c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-get-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-accessor-get-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Accessor get Method) (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static get # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js new file mode 100644 index 0000000000..1bdb780ff9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-accessor-set-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-accessor-set-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Accessor set Method) (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static set # m(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js new file mode 100644 index 0000000000..dba900b549 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-gen-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-async-gen-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Async Generator Method) (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async * # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js new file mode 100644 index 0000000000..9f6173efa6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-async-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-async-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Async Method) (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js new file mode 100644 index 0000000000..0ad5d4d5ad --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field-init.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-field-init.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Field with Initializer) (class declaration) +esid: prod-ClassElement +features: [class-static-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static # x = 1; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js new file mode 100644 index 0000000000..eb8f843799 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-field.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-field.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Field) (class declaration) +esid: prod-ClassElement +features: [class-static-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static # x; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js new file mode 100644 index 0000000000..54b6ecabcc --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-gen-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-gen-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Generator Method) (class declaration) +esid: prod-ClassElement +features: [generators, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static * # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js new file mode 100644 index 0000000000..36eeb8909e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatename-whitespace-error-static-meth.js @@ -0,0 +1,30 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-whitespace-error-static-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: No space allowed between sigil and IdentifierName (Static Method) (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Updated Productions + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + static # m() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js new file mode 100644 index 0000000000..c8864ba6d1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatenames-same-line-error.js @@ -0,0 +1,37 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatenames-same-line-error.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C { + #x #y +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js new file mode 100644 index 0000000000..aab8077de5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async-gen.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-async-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Async Generator Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + async * method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js new file mode 100644 index 0000000000..747a8d620c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-async.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-async.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Async Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + async method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js new file mode 100644 index 0000000000..99f1e7063c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-gen.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Generator Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + * method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js new file mode 100644 index 0000000000..a048d184b3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-get.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-get.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Accessor get Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + get method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js new file mode 100644 index 0000000000..0875eaebee --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-method.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-method.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js new file mode 100644 index 0000000000..3e917f35d0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async-gen.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-private-async-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Private Async Generators Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + async * #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js new file mode 100644 index 0000000000..fc85b76c65 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-async.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-private-async.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Private Async Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-functions, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + async #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js new file mode 100644 index 0000000000..fedbf4f537 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-gen.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-private-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Private Generators Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [generators, class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + * #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js new file mode 100644 index 0000000000..225be8c596 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-private-method.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-private-method.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Private Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js new file mode 100644 index 0000000000..61e1a5822d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-contains-super-set.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-contains-super-set.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Accessor set Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + set method(_) { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js new file mode 100644 index 0000000000..dd194f37ca --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-gen.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-ctor-async-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Async Generator Methods cannot be named "constructor" (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C { + async * constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js new file mode 100644 index 0000000000..060b9ba43b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-async-meth.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-ctor-async-meth.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Async Methods cannot be named "constructor" (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C { + async constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js new file mode 100644 index 0000000000..450de53c77 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-gen.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-ctor-gen.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Generator Methods cannot be named "constructor" (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C { + * constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js new file mode 100644 index 0000000000..00c65e6241 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-get.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-ctor-get.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Accessor get Methods cannot be named "constructor" (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C { + get constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js new file mode 100644 index 0000000000..8f256e51c3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-special-meth-ctor-set.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-meth-ctor-set.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Accessor set Methods cannot be named "constructor" (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C { + set constructor(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js new file mode 100644 index 0000000000..2441d89e52 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-async-gen-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Generator Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async * prototype() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js new file mode 100644 index 0000000000..25c654dfb0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-gen-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-async-gen-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Generator Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static async * method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js new file mode 100644 index 0000000000..dc9adf1f87 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-async-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async prototype() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-super.js new file mode 100644 index 0000000000..04d2fce7c7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-async-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-async-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static async method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js new file mode 100644 index 0000000000..9b9c8652eb --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-gen-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Generator Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static * prototype() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js new file mode 100644 index 0000000000..d24645e094 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-gen-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-gen-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Generator Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static * method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js new file mode 100644 index 0000000000..bec83f9f53 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-get-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Accessor get Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static get prototype() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-super.js new file mode 100644 index 0000000000..9512bc196d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-get-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-get-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Accessor get Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static get method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-prototype.js new file mode 100644 index 0000000000..1266ed80d5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static prototype() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-super.js new file mode 100644 index 0000000000..8ae98066f7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js new file mode 100644 index 0000000000..758ef67cb1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-gen-meth-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Generator Private Methods cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async * #constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js new file mode 100644 index 0000000000..19b6d5b5d8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-gen-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-gen-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Generator Private Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static async * #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js new file mode 100644 index 0000000000..da9f303bc8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-meth-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Private Methods cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [async-functions, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static async #constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js new file mode 100644 index 0000000000..cf74261edd --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-async-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Async Private Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [async-functions, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static async #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js new file mode 100644 index 0000000000..4f5d06c598 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-gen-meth-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Generator Private Methods cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [generators, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static * #constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js new file mode 100644 index 0000000000..e325b10007 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-gen-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-gen-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Generator Private Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [generators, class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static * #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js new file mode 100644 index 0000000000..e1631c7cf4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-meth-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Private Methods cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static #constructor() {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-super.js new file mode 100644 index 0000000000..9518ab56ff --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-private-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Private Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static #method() { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js new file mode 100644 index 0000000000..5384df5dfe --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-privatename-constructor.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-privatename-constructor.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Private Fields cannot be named constructor (class declaration) +esid: prod-ClassElement +features: [class-static-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElementName : PrivateName ; + It is a Syntax Error if StringValue of PrivateName is "#constructor" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static #constructor +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js new file mode 100644 index 0000000000..24c099802d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-prototype.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-set-meth-prototype.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Accessor set Methods cannot be named prototype (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +$DONOTEVALUATE(); + +class C { + static set prototype(_) {} +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-super.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-super.js new file mode 100644 index 0000000000..66475a758c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-static-set-meth-super.js @@ -0,0 +1,28 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-set-meth-super.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: Static Accessor set Methods cannot contain direct super (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + +---*/ + + +$DONOTEVALUATE(); + +class C extends Function{ + static set method(_) { + super(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/browser.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js new file mode 100644 index 0000000000..40c53ece98 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = (() => {})().#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js new file mode 100644 index 0000000000..68341532c1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = (() => this)().#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js new file mode 100644 index 0000000000..615c5a91d8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer-fn.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, function in class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = function() { (() => {})().#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js new file mode 100644 index 0000000000..953d7c6f8f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer-fn.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, function in class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = function() { (() => this)().#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js new file mode 100644 index 0000000000..060ba0152f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer-fn.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, function in class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = function() { something.#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js new file mode 100644 index 0000000000..c2852bb8a7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer-fn.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, function in class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = function() { this.#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js new file mode 100644 index 0000000000..4db6d17b25 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = something.#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js new file mode 100644 index 0000000000..cec95a1460 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + f = this.#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-bad-reference.js new file mode 100644 index 0000000000..06d1a91584 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-bad-reference.js @@ -0,0 +1,58 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer-heritage.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + f = (() => {})().#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-this.js new file mode 100644 index 0000000000..483a835d70 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-call-expression-this.js @@ -0,0 +1,58 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer-heritage.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + f = (() => this)().#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-bad-reference.js new file mode 100644 index 0000000000..dce5883462 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-bad-reference.js @@ -0,0 +1,58 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-field-initializer-heritage.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + f = something.#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-this.js new file mode 100644 index 0000000000..fb8dceaf2f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/fields-init-heritage-member-expression-this.js @@ -0,0 +1,58 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-field-initializer-heritage.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, class field initializer in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + f = this.#x +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js new file mode 100644 index 0000000000..a3b8d6b0f4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { (() => {})().#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js new file mode 100644 index 0000000000..6596ef5dc0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-method.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { (() => this)().#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js new file mode 100644 index 0000000000..7296cac6a2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js @@ -0,0 +1,45 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method-fn.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, inner function in method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + function fn() { (() => {})().#x } + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js new file mode 100644 index 0000000000..13559da5b6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js @@ -0,0 +1,45 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-method-fn.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, inner function in method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + function fn() { (() => this)().#x } + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js new file mode 100644 index 0000000000..023631b29a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js @@ -0,0 +1,45 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method-fn.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, inner function in method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + function fn() { something.#x } + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js new file mode 100644 index 0000000000..7ea61ba52a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js @@ -0,0 +1,45 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-method-fn.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, inner function in method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + function fn() { this.#x } + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js new file mode 100644 index 0000000000..e43b5446e5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method-heritage.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + m() { + (() => {})().#x + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js new file mode 100644 index 0000000000..ce7669e83f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-method-heritage.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + m() { + (() => this)().#x + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js new file mode 100644 index 0000000000..0eeb130e09 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method-heritage.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + m() { + something.#x + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js new file mode 100644 index 0000000000..dea9d1d473 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-method-heritage.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class Parent { + #x = 42; +} + +class C extends Parent { + m() { + this.#x + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js new file mode 100644 index 0000000000..bae36e873a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-method.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { something.#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js new file mode 100644 index 0000000000..baf7573389 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js @@ -0,0 +1,43 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-method.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, method in class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { this.#x } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js new file mode 100644 index 0000000000..b66bdcf9fd --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-outter-method.template +/*--- +description: bad reference in call expression (Invalid private names should throw a SyntaxError, method in outter class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + class Outter { + #x = 42; + } + + this.#x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js new file mode 100644 index 0000000000..7d989a3e74 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/call-expression-this.case +// - src/invalid-private-names/default/cls-decl-outter-method.template +/*--- +description: this evaluated in call expression (Invalid private names should throw a SyntaxError, method in outter class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + class Outter { + #x = 42; + } + + this.#x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js new file mode 100644 index 0000000000..8c6ffeb17a --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-bad-reference.case +// - src/invalid-private-names/default/cls-decl-outter-method.template +/*--- +description: bad reference in member expression (Invalid private names should throw a SyntaxError, method in outter class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + class Outter { + #x = 42; + } + + this.#x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js new file mode 100644 index 0000000000..41926b597c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js @@ -0,0 +1,59 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/invalid-private-names/member-expression-this.case +// - src/invalid-private-names/default/cls-decl-outter-method.template +/*--- +description: this reference in member expression (Invalid private names should throw a SyntaxError, method in outter class declaration) +esid: sec-static-semantics-early-errors +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ScriptBody:StatementList + It is a Syntax Error if AllPrivateNamesValid of StatementList with an empty List + as an argument is false unless the source code is eval code that is being + processed by a direct eval. + + ModuleBody:ModuleItemList + It is a Syntax Error if AllPrivateNamesValid of ModuleItemList with an empty List + as an argument is false. + + Static Semantics: AllPrivateNamesValid + + ClassBody : ClassElementList + 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. + 2. Return AllPrivateNamesValid of ClassElementList with the argument newNames. + + For all other grammatical productions, recurse on subexpressions/substatements, + passing in the names of the caller. If all pieces return true, then return true. + If any returns false, return false. + + + Static Semantics: AllPrivateNamesValid + + MemberExpression : MemberExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + + CallExpression : CallExpression . PrivateName + + 1. If StringValue of PrivateName is in names, return true. + 2. Return false. + +---*/ + + +$DONOTEVALUATE(); + +class C { + m() { + class Outter { + #x = 42; + } + + this.#x; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/shell.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/invalid-names/shell.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js new file mode 100644 index 0000000000..f152b5758b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async generator cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + async * \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js new file mode 100644 index 0000000000..cd8caf5df0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-async-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async method cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + async \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js new file mode 100644 index 0000000000..b949e50764 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-call-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-call-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + method() { + foo().\u0023field; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-field-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-field-cannot-escape-token.js new file mode 100644 index 0000000000..8be2cdca1c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-field-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private field cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u0023field; +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js new file mode 100644 index 0000000000..facd9e48c6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private generator cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + * \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js new file mode 100644 index 0000000000..61d2b6282c --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-member-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-member-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + method() { + this.\u0023field; + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-method-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-method-cannot-escape-token.js new file mode 100644 index 0000000000..8084f90cc1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/private-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private method cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/shell.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/shell.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js new file mode 100644 index 0000000000..dffad30511 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js @@ -0,0 +1,37 @@ +// |reftest| error:SyntaxError +// This file was procedurally generated from the following sources: +// - src/class-elements/super-private-access-invalid.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: It is syntax error if PrivateName IdentifierName is accessed on SuperProperty (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + SuperProperty: + super[Expression] + super.IdentifierName + +---*/ + + +$DONOTEVALUATE(); + +class C extends B +{ + #x() {} + + method() { + super.#x(); + } +} diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/shell.js b/js/src/tests/test262/language/statements/class/elements/syntax/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/shell.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/browser.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/browser.js diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js new file mode 100644 index 0000000000..fdf55541d9 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-class-body-ctor-no-heritage.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-class-body-ctor-no-heritage.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: A constructor is valid without a super call in the constructor and heritage (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +info: | + ClassTail : ClassHeritageopt { ClassBody } + + It is a Syntax Error if ClassHeritage is not present and the following algorithm evaluates to true: + 1. Let constructor be ConstructorMethod of ClassBody. + 2. If constructor is empty, return false. + 3. Return HasDirectSuper of constructor. + +---*/ + + +class C { + constructor() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-accessor.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-accessor.js new file mode 100644 index 0000000000..eafce8744d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-accessor.js @@ -0,0 +1,27 @@ +// |reftest| skip -- decorators is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-accessor.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid accessor FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [decorators, class] +flags: [generated] +info: | + FieldDefinition[Yield, Await] : + ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt + accessor [no LineTerminator here] ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt + +---*/ + + +class C { + accessor $; + accessor _; + accessor \u{6F}; + accessor \u2118; + accessor ZW_\u200C_NJ; + accessor ZW_\u200D_J; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js new file mode 100644 index 0000000000..d0b8f03ba4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer-alt.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-classelementname-initializer-alt.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; + _ = 2; + \u{6F} = 3; + ℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW__NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW__J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer.js new file mode 100644 index 0000000000..143e21ced4 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-classelementname-initializer.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-classelementname-initializer.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $ = 1; + _ = 2; + \u{6F} = 3; + \u2118 = 4; + ZW_\u200C_NJ = 5; + ZW_\u200D_J = 6; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier-alt.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier-alt.js new file mode 100644 index 0000000000..37c11e23d8 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier-alt.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-identifier-alt.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; + _; + \u{6F}; + ℘; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW__NJ; // DO NOT CHANGE THE NAME OF THIS FIELD + ZW__J; // DO NOT CHANGE THE NAME OF THIS FIELD +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier.js new file mode 100644 index 0000000000..0151ed8286 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-field-identifier.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-field-identifier.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + StringLiteral + NumericLiteral + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart :: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart :: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue :: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + $; + _; + \u{6F}; + \u2118; + ZW_\u200C_NJ; + ZW_\u200D_J; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-fields-multi-line.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-fields-multi-line.js new file mode 100644 index 0000000000..73bde20af2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-fields-multi-line.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-fields-multi-line.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid multi-line, multi-field (class declaration) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +class C { + x + y +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js new file mode 100644 index 0000000000..482b6920dd --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-get-set.js @@ -0,0 +1,23 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-get-set.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: It's valid if a class contains a private getter and a private setter with the same name (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +class C { + get #m() {} + set #m(_) {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js new file mode 100644 index 0000000000..ef9ea621c2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: It's valid if a nested class shadows a private method (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries. + +---*/ + + +class C { + constructor() { + class B { + #m() {} + } + } + + #m() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js new file mode 100644 index 0000000000..c741b7755d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer-alt.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-classelementname-initializer-alt.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #℘ = 4; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW__NJ = 5; // DO NOT CHANGE THE NAME OF THIS FIELD + #ZW__J = 6; // DO NOT CHANGE THE NAME OF THIS FIELD +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js new file mode 100644 index 0000000000..e80e425b7e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-classelementname-initializer.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-classelementname-initializer.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + Initializer : + = AssignmentExpression + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #\u2118 = 4; + #ZW_\u200C_NJ = 5; + #ZW_\u200D_J = 6; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-identifier.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-identifier.js new file mode 100644 index 0000000000..d0166b4b60 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-identifier.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-identifier.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Valid PrivateName Syntax (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +---*/ + + +class C { + #$; + #_; + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..200f8b280e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatename-no-initializer-with-method.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +class C { + #x + m() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatenames-multi-line.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatenames-multi-line.js new file mode 100644 index 0000000000..e00ef3ed47 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatenames-multi-line.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-privatenames-multi-line.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: SyntaxError (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +---*/ + + +class C { + #x + #y +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js new file mode 100644 index 0000000000..d3cb1b1ce1 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-accessor-meth-valid.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-accessor-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Accessor Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + MethodDefinition : get PropertyName ( ) { FunctionBody } + + [...] + 9. Let desc be the PropertyDescriptor { [[Get]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 10. Return ? DefinePropertyOrThrow(object, propKey, desc). + + MethodDefinition : set PropertyName ( PropertySetParameterList ) { FunctionBody } + + [...] + 8. Let desc be the PropertyDescriptor { [[Set]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 9. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + get prototype() { return 13; } + set prototype(_) {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +assert.sameValue(C.prototype.prototype, 13); +verifyProperty(C.prototype, 'prototype', { + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js new file mode 100644 index 0000000000..2c7e0c8f6d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-gen-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-async-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Async Generator Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + AsyncGeneratorMethod : async * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + [...] + 10. Let desc be PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 11. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + async * prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js new file mode 100644 index 0000000000..17fa1970f5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-async-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-async-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Async Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } + + [...] + 8. Let desc be the PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 9. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + async prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js new file mode 100644 index 0000000000..ac18e1f825 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-gen-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Generator Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + GeneratorMethod : * PropertyName ( UniqueFormalParameters ) { GeneratorBody } + + [...] + 10. Let desc be the PropertyDescriptor { [[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 11. Return ? DefinePropertyOrThrow(object, propKey, desc). + +---*/ + + +class C { + * prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js new file mode 100644 index 0000000000..04ecfae0a3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-special-prototype-meth-valid.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-special-prototype-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Methods can be named "prototype" (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ClassTail : ClassHeritage_opt { ClassBody_opt } + + [...] + 6. Let proto be OrdinaryObjectCreate(protoParent). + [...] + 14. Perform MakeConstructor(F, false, proto). + [...] + 20. For each ClassElement m in order from methods, do + a. If IsStatic of m is false, then + i. Let status be PropertyDefinitionEvaluation of m with arguments proto and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + With parameters object and enumerable. + + MethodDefinition : PropertyName ( UniqueFormalParameters ) { FunctionBody } + + [...] + 3. Let desc be the PropertyDescriptor { [[Value]]: methodDef.[[Closure]], [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true }. + 4. Return ? DefinePropertyOrThrow(object, methodDef.[[Key]], desc). + +---*/ + + +class C { + prototype() {} +} + +assert(C.hasOwnProperty('prototype')); +assert(C.prototype.hasOwnProperty('prototype')); +assert.notSameValue(C.prototype.prototype, C.prototype); +verifyProperty(C.prototype, 'prototype', { + writable: true, + enumerable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js new file mode 100644 index 0000000000..50394530b3 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-accessor-meth-valid.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-ctor-accessor-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Accessor Methods can be named constructor (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "prototype". + +---*/ + + +class C { + static get constructor() {} + static set constructor(_) {} + constructor() {} // stacks with a valid constructor +} + +assert(C.hasOwnProperty('constructor')); +assert(C.prototype.hasOwnProperty('constructor')); +assert.notSameValue(C.prototype.constructor, C.constructor); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js new file mode 100644 index 0000000000..59d173ff32 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-gen-meth-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-ctor-async-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Async Generator Methods can be named constructor (class declaration) +esid: prod-ClassElement +features: [async-iteration, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "prototype". + +---*/ + + +class C { + static async * constructor() {} + constructor() {} // stacks with a valid constructor +} + +assert(C.hasOwnProperty('constructor')); +assert(C.prototype.hasOwnProperty('constructor')); +assert.notSameValue(C.prototype.constructor, C.constructor); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js new file mode 100644 index 0000000000..47fbf0c78f --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-async-meth-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-ctor-async-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Methods can be named constructor (class declaration) +esid: prod-ClassElement +features: [async-functions, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "prototype". + +---*/ + + +class C { + static async constructor() {} + constructor() {} // stacks with a valid constructor +} + +assert(C.hasOwnProperty('constructor')); +assert(C.prototype.hasOwnProperty('constructor')); +assert.notSameValue(C.prototype.constructor, C.constructor); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js new file mode 100644 index 0000000000..24f54213ef --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-gen-meth-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-ctor-gen-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Generator Methods can be named constructor (class declaration) +esid: prod-ClassElement +features: [generators, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "prototype". + +---*/ + + +class C { + static * constructor() {} + constructor() {} // stacks with a valid constructor +} + +assert(C.hasOwnProperty('constructor')); +assert(C.prototype.hasOwnProperty('constructor')); +assert.notSameValue(C.prototype.constructor, C.constructor); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js new file mode 100644 index 0000000000..7b778bc72b --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-ctor-meth-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-ctor-meth-valid.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Methods can be named constructor (class declaration) +esid: prod-ClassElement +features: [class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is not "constructor" and HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "constructor" and SpecialMethod of MethodDefinition is true. + ClassElement : static MethodDefinition + It is a Syntax Error if HasDirectSuper of MethodDefinition is true. + It is a Syntax Error if PropName of MethodDefinition is "prototype". + +---*/ + + +class C { + static constructor() {} + constructor() {} // stacks with a valid constructor +} + +assert(C.hasOwnProperty('constructor')); +assert(C.prototype.hasOwnProperty('constructor')); +assert.notSameValue(C.prototype.constructor, C.constructor); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js new file mode 100644 index 0000000000..7c7b26a27d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-gen-meth-prototype.js @@ -0,0 +1,22 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-gen-meth-prototype.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Async Generator Private Methods can be named "#prototype" (class declaration) +esid: prod-ClassElement +features: [async-iteration, class-static-methods-private, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +class C { + static async * #prototype() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js new file mode 100644 index 0000000000..445dea39c6 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-async-meth-prototype.js @@ -0,0 +1,22 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-async-meth-prototype.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Async Private Methods can be named "#prototype" (class declaration) +esid: prod-ClassElement +features: [async-functions, class-static-methods-private, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +class C { + static async #prototype() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js new file mode 100644 index 0000000000..5a15aae437 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-gen-meth-prototype.js @@ -0,0 +1,22 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-gen-meth-prototype.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Generator Private Methods can be named "#prototype" (class declaration) +esid: prod-ClassElement +features: [generators, class-static-methods-private, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +class C { + static * #prototype() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-meth-prototype.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-meth-prototype.js new file mode 100644 index 0000000000..6907ef0886 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-static-private-meth-prototype.js @@ -0,0 +1,22 @@ +// This file was procedurally generated from the following sources: +// - src/class-elements/grammar-static-private-meth-prototype.case +// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template +/*--- +description: Static Private Methods can be named "#prototype" (class declaration) +esid: prod-ClassElement +features: [class-static-methods-private, class] +flags: [generated] +info: | + Class Definitions / Static Semantics: Early Errors + + ClassElement : static MethodDefinition + It is a Syntax Error if PropName of MethodDefinition is "prototype" + +---*/ + + +class C { + static #prototype() {} +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/elements/syntax/valid/shell.js b/js/src/tests/test262/language/statements/class/elements/syntax/valid/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/elements/syntax/valid/shell.js |