From f2d76e60f27fa96d494a9d77e44ff04db44276ed Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Thu, 12 Oct 2017 17:30:16 -0400 Subject: [PATCH 01/40] class fields: add early errors for argument and super # Conflicts: # src/class-fields/init-err-contains-super.case --- .../init-err-contains-boolean.case | 28 +++++++++++++++++++ .../cls-decl-fields-comp-name.template | 15 ++++++++++ .../cls-decl-fields-static-comp-name.template | 15 ++++++++++ ...s-decl-fields-static-literal-name.template | 14 ++++++++++ ...fields-static-string-literal-name.template | 14 ++++++++++ .../cls-expr-fields-static-comp-name.template | 15 ++++++++++ ...s-expr-fields-static-literal-name.template | 14 ++++++++++ ...fields-static-string-literal-name.template | 14 ++++++++++ 8 files changed, 129 insertions(+) create mode 100644 src/class-fields/init-err-contains-boolean.case create mode 100644 src/class-fields/initializer-error/cls-decl-fields-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template diff --git a/src/class-fields/init-err-contains-boolean.case b/src/class-fields/init-err-contains-boolean.case new file mode 100644 index 0000000000..605cdd32dd --- /dev/null +++ b/src/class-fields/init-err-contains-boolean.case @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Syntax error if `arguments` used in class field +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. +features: [class-fields] +negative: + type: SyntaxError + phase: early +template: initializer-error +---*/ + +//- initializer +arguments diff --git a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template new file mode 100644 index 0000000000..a922c25b80 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-comp-name- +name: computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template new file mode 100644 index 0000000000..b4eb238479 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-comp-name- +name: static computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template new file mode 100644 index 0000000000..335d76793f --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-literal- +name: static literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template new file mode 100644 index 0000000000..5fd801e187 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-string-literal-name- +name: static string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template new file mode 100644 index 0000000000..cb44207f4e --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-comp-name- +name: static computed ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template new file mode 100644 index 0000000000..0a840e01ef --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-literal- +name: static literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template new file mode 100644 index 0000000000..deed9b15e3 --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-string-literal-name- +name: static string literal ClassElementName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = /*{ initializer }*/; +} From ac5e65af6942a048aeda3c6646ed200d202f8721 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Wed, 18 Oct 2017 15:24:39 -0400 Subject: [PATCH 02/40] Add private fields tests of early errors and small fix --- .../init-err-contains-boolean.case | 28 ------------------- ...s-decl-fields-static-private-name.template | 14 ++++++++++ ...s-expr-fields-static-private-name.template | 14 ++++++++++ 3 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 src/class-fields/init-err-contains-boolean.case create mode 100644 src/class-fields/initializer-error/cls-decl-fields-static-private-name.template create mode 100644 src/class-fields/initializer-error/cls-expr-fields-static-private-name.template diff --git a/src/class-fields/init-err-contains-boolean.case b/src/class-fields/init-err-contains-boolean.case deleted file mode 100644 index 605cdd32dd..0000000000 --- a/src/class-fields/init-err-contains-boolean.case +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: Syntax error if `arguments` used in class field -info: | - Static Semantics: Early Errors - - FieldDefinition: - PropertyNameInitializeropt - - - It is a Syntax Error if ContainsArguments of Initializer is true. - - Static Semantics: ContainsArguments - IdentifierReference : Identifier - - 1. If the StringValue of Identifier is "arguments", return true. - ... - For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. -features: [class-fields] -negative: - type: SyntaxError - phase: early -template: initializer-error ----*/ - -//- initializer -arguments diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template new file mode 100644 index 0000000000..c50194b6a5 --- /dev/null +++ b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-static-private- +name: static PrivateName +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static #x = /*{ initializer }*/; +} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template new file mode 100644 index 0000000000..0d3c770f9b --- /dev/null +++ b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template @@ -0,0 +1,14 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-static-private- +name: static PrivateName +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static #x = /*{ initializer }*/; +} From 2488cb99b39e51819d6f5e3a9d412fe0c3073713 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Wed, 18 Oct 2017 18:41:51 -0400 Subject: [PATCH 03/40] classfields tests for eval early errors # Conflicts: # src/class-fields/eval-err-contains-arguments.case # src/class-fields/eval-err-contains-supercall-1.case # src/class-fields/eval-err-contains-supercall-2.case # src/class-fields/eval-err-contains-supercall.case # src/class-fields/eval-err-contains-superproperty-1.case # src/class-fields/eval-err-contains-superproperty-2.case --- .../eval-err-contains-newcall.case | 28 +++++++++++++++++++ .../eval-err-contains-supercall-1.case | 5 ++++ .../eval-err-contains-supercall-2.case | 12 ++++---- .../eval-err-contains-supercall.case | 4 +++ .../eval-err-contains-superproperty-1.case | 4 +++ .../eval-err-contains-superproperty-2.case | 10 +++---- .../cls-decl-fields-eval.template | 21 ++++++++++++++ .../cls-decl-fields-indirect-eval.template | 21 ++++++++++++++ .../cls-expr-fields-eval.template | 21 ++++++++++++++ .../cls-expr-fields-indirect-eval.template | 21 ++++++++++++++ .../cls-decl-fields-eval.template | 19 +++++++++++++ .../cls-decl-fields-indirect-eval.template | 19 +++++++++++++ .../cls-expr-fields-eval.template | 19 +++++++++++++ .../cls-expr-fields-indirect-eval.template | 19 +++++++++++++ 14 files changed, 211 insertions(+), 12 deletions(-) create mode 100644 src/class-fields/eval-err-contains-newcall.case create mode 100644 src/class-fields/initializer-eval-super/cls-decl-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-expr-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval/cls-decl-fields-eval.template create mode 100644 src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval/cls-expr-fields-eval.template create mode 100644 src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template diff --git a/src/class-fields/eval-err-contains-newcall.case b/src/class-fields/eval-err-contains-newcall.case new file mode 100644 index 0000000000..530988a5bd --- /dev/null +++ b/src/class-fields/eval-err-contains-newcall.case @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: error if `new.call` in StatementList of eval +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Functions + These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. + ScriptBody:StatementList + + It is a Syntax Error if StatementList Contains NewTarget. +features: [class, class-fields-public] +template: initializer-eval +---*/ + +//- initializer +new.call +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/eval-err-contains-supercall-1.case b/src/class-fields/eval-err-contains-supercall-1.case index 27469abd5e..5700ca64ee 100644 --- a/src/class-fields/eval-err-contains-supercall-1.case +++ b/src/class-fields/eval-err-contains-supercall-1.case @@ -22,3 +22,8 @@ template: initializer-eval-super-call //- initializer super()['x'] + +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/eval-err-contains-supercall-2.case b/src/class-fields/eval-err-contains-supercall-2.case index cdddc77917..1c6a7b00b7 100644 --- a/src/class-fields/eval-err-contains-supercall-2.case +++ b/src/class-fields/eval-err-contains-supercall-2.case @@ -4,21 +4,19 @@ /*--- desc: error if `super().x` in StatementList of eval info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. ScriptBody:StatementList It is a Syntax Error if StatementList Contains SuperCall. + features: [class, class-fields-public] template: initializer-eval-super-call ---*/ //- initializer super().x +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/eval-err-contains-supercall.case b/src/class-fields/eval-err-contains-supercall.case index 55e7f213f2..9681120f08 100644 --- a/src/class-fields/eval-err-contains-supercall.case +++ b/src/class-fields/eval-err-contains-supercall.case @@ -22,3 +22,7 @@ template: initializer-eval-super-call //- initializer super() +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/eval-err-contains-superproperty-1.case b/src/class-fields/eval-err-contains-superproperty-1.case index 9241e3a1c4..14706db8de 100644 --- a/src/class-fields/eval-err-contains-superproperty-1.case +++ b/src/class-fields/eval-err-contains-superproperty-1.case @@ -22,3 +22,7 @@ template: initializer-eval-super-property //- initializer super.x +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/eval-err-contains-superproperty-2.case b/src/class-fields/eval-err-contains-superproperty-2.case index f770e42cdb..33fa810bde 100644 --- a/src/class-fields/eval-err-contains-superproperty-2.case +++ b/src/class-fields/eval-err-contains-superproperty-2.case @@ -4,11 +4,6 @@ /*--- desc: error if `super['x']` in StatementList of eval info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods @@ -16,9 +11,14 @@ info: | ScriptBody:StatementList It is a Syntax Error if StatementList Contains SuperProperty. + features: [class, class-fields-public] template: initializer-eval-super-property ---*/ //- initializer super['x'] +//- earlyerror +SyntaxError +//- executionerror +SyntaxError diff --git a/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template new file mode 100644 index 0000000000..101cf30b38 --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-direct- +name: direct eval +---*/ + +class A = {} + +var executed = false; +class C extends A = { + x = eval('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template new file mode 100644 index 0000000000..9d77186bf2 --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +class A = {} + +var executed = false; +class C extends A = { + x = (0, eval)('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template new file mode 100644 index 0000000000..39597e8807 --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-direct- +name: direct eval +---*/ + +A = class {} + +var executed = false; +C = class extends A { + x = eval('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template new file mode 100644 index 0000000000..86db54edbc --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +A = class {} + +var executed = false; +C = class extends A { + x = (0, eval)('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval/cls-decl-fields-eval.template b/src/class-fields/initializer-eval/cls-decl-fields-eval.template new file mode 100644 index 0000000000..ed721afebe --- /dev/null +++ b/src/class-fields/initializer-eval/cls-decl-fields-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-direct- +name: direct eval +---*/ + +var executed = false; +class C = { + x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template new file mode 100644 index 0000000000..11aa34d0da --- /dev/null +++ b/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-indirect- +name: indirect eval +---*/ + +var executed = false; +class C = { + x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval/cls-expr-fields-eval.template b/src/class-fields/initializer-eval/cls-expr-fields-eval.template new file mode 100644 index 0000000000..9915d0d098 --- /dev/null +++ b/src/class-fields/initializer-eval/cls-expr-fields-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-direct- +name: direct eval +---*/ + +var executed = false; +C = class { + x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template new file mode 100644 index 0000000000..d04a83dfb9 --- /dev/null +++ b/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-indirect- +name: indirect eval +---*/ + +var executed = false; +C = class { + x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); From ea643db26fc6559ac7b2ca9982ecf26434b5b796 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Fri, 20 Oct 2017 20:03:09 -0400 Subject: [PATCH 04/40] classfields: add tests for forbidden propertynames # Conflicts: # src/class-fields/propname-constructor.case # src/class-fields/propname-error/cls-decl-computed-name.template # src/class-fields/propname-error/cls-decl-literal-name.template # src/class-fields/propname-error/cls-decl-string-name.template # src/class-fields/propname-error/cls-expr-computed-name.template # src/class-fields/propname-error/cls-expr-literal-name.template # src/class-fields/propname-error/cls-expr-string-name.template --- .../static-propname-constructor.case | 20 +++++++++++++++++++ .../static-propname-prototype.case | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/class-fields/static-propname-constructor.case create mode 100644 src/class-fields/static-propname-prototype.case diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case new file mode 100644 index 0000000000..ffa6754e20 --- /dev/null +++ b/src/class-fields/static-propname-constructor.case @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Static class field cannot have PropName 'constructor' +info: | + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". +features: [class-fields] +template: propname-error +---*/ + +//- static +static +//- propname +constructor diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case new file mode 100644 index 0000000000..9b2e9ab331 --- /dev/null +++ b/src/class-fields/static-propname-prototype.case @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Static class fields cannot have PropName 'prototype' +info: | + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". +features: [class-fields] +template: propname-error +---*/ + +//- static +static +//- propname +prototype From d361aaadb82d8c197ce6470f88ba5fd40792a7b5 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Tue, 31 Oct 2017 14:19:30 -0400 Subject: [PATCH 05/40] Fixes for forbidden property names # Conflicts: # src/class-fields/propname-error/cls-decl-variable-name.template # src/class-fields/propname-error/cls-expr-variable-name.template --- .../propname-error/cls-decl-variable-name.template | 3 +-- .../propname-error/cls-expr-variable-name.template | 7 +++---- src/class-fields/static-propname-constructor.case | 2 +- src/class-fields/static-propname-prototype.case | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/class-fields/propname-error/cls-decl-variable-name.template b/src/class-fields/propname-error/cls-decl-variable-name.template index ade7741a30..cbda5b8319 100644 --- a/src/class-fields/propname-error/cls-decl-variable-name.template +++ b/src/class-fields/propname-error/cls-decl-variable-name.template @@ -14,10 +14,9 @@ info: | var /*{ propname }*/ = 'foo'; class C { - [/*{ propname }*/]; + /*{ static }*/ [/*{ propname }*/]; } var c = new C(); assert.sameValue(c.hasOwnProperty("foo"), true); -assert.sameValue(C.hasOwnProperty("foo"), false); diff --git a/src/class-fields/propname-error/cls-expr-variable-name.template b/src/class-fields/propname-error/cls-expr-variable-name.template index 1435862de5..50b255197f 100644 --- a/src/class-fields/propname-error/cls-expr-variable-name.template +++ b/src/class-fields/propname-error/cls-expr-variable-name.template @@ -14,10 +14,9 @@ info: | var /*{ propname }*/ = 'foo'; var C = class { - [/*{ propname }*/]; -}; + /*{ static }*/ [/*{ propname }*/]; +} var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), true); -assert.sameValue(C.hasOwnProperty("foo"), false); +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case index ffa6754e20..ff3d00af6a 100644 --- a/src/class-fields/static-propname-constructor.case +++ b/src/class-fields/static-propname-constructor.case @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: Static class field cannot have PropName 'constructor' +desc: static class field forbid PropName 'constructor' info: | // This test file tests the following early error: diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case index 9b2e9ab331..99d85ff64a 100644 --- a/src/class-fields/static-propname-prototype.case +++ b/src/class-fields/static-propname-prototype.case @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: Static class fields cannot have PropName 'prototype' +desc: static class fields forbid PropName 'prototype' info: | // This test file tests the following early error: From 2f458d164fb6dff1cd4d5b219eff0ce20dd97d26 Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Mon, 30 Oct 2017 00:34:05 -0400 Subject: [PATCH 06/40] class fields: added tests for privatename production # Conflicts: # src/class-fields/default/cls-decl-after-same-line-async-gen.template # src/class-fields/default/cls-decl-after-same-line-async-method.template # src/class-fields/default/cls-decl-after-same-line-gen.template # src/class-fields/default/cls-decl-after-same-line-method.template # src/class-fields/default/cls-decl-after-same-line-static-async-gen.template # src/class-fields/default/cls-decl-after-same-line-static-async-method.template # src/class-fields/default/cls-decl-after-same-line-static-gen.template # src/class-fields/default/cls-decl-after-same-line-static-method.template # src/class-fields/default/cls-decl-multiple-definitions.template # src/class-fields/default/cls-decl-multiple-stacked-definitions.template # src/class-fields/default/cls-decl-new-no-sc-line-method.template # src/class-fields/default/cls-decl-new-sc-line-generator.template # src/class-fields/default/cls-decl-new-sc-line-method.template # src/class-fields/default/cls-decl-regular-definitions.template # src/class-fields/default/cls-decl-same-line-generator.template # src/class-fields/default/cls-decl-same-line-method.template # src/class-fields/default/cls-decl-wrapped-in-sc.template # src/class-fields/default/cls-expr-after-same-line-async-gen.template # src/class-fields/default/cls-expr-after-same-line-async-method.template # src/class-fields/default/cls-expr-after-same-line-gen.template # src/class-fields/default/cls-expr-after-same-line-method.template # src/class-fields/default/cls-expr-after-same-line-static-async-gen.template # src/class-fields/default/cls-expr-after-same-line-static-async-method.template # src/class-fields/default/cls-expr-after-same-line-static-gen.template # src/class-fields/default/cls-expr-after-same-line-static-method.template # src/class-fields/default/cls-expr-multiple-definitions.template # src/class-fields/default/cls-expr-multiple-stacked-definitions.template # src/class-fields/default/cls-expr-new-no-sc-line-method.template # src/class-fields/default/cls-expr-new-sc-line-generator.template # src/class-fields/default/cls-expr-new-sc-line-method.template # src/class-fields/default/cls-expr-regular-definitions.template # src/class-fields/default/cls-expr-same-line-generator.template # src/class-fields/default/cls-expr-same-line-method.template # src/class-fields/default/cls-expr-wrapped-in-sc.template # src/class-fields/private-names.case --- src/class-fields/static-private-names.case | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/class-fields/static-private-names.case diff --git a/src/class-fields/static-private-names.case b/src/class-fields/static-private-names.case new file mode 100644 index 0000000000..464b53a9e9 --- /dev/null +++ b/src/class-fields/static-private-names.case @@ -0,0 +1,50 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: literal private names +info: | + ClassElement: + ... + static FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PrivateName + + PrivateName: + #IdentifierName +template: default +---*/ + +//- fields +static #x; static #y +//- privateinspectionfunctions + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +//- assertions + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); From 5d014bdfba34affacd320d9d3f407bd346b0323b Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Wed, 1 Nov 2017 10:27:52 -0400 Subject: [PATCH 07/40] classfields: field definition abrupt completion tests # Conflicts: # test/language/statements/class/classelementname-abrupt-completion.js # test/language/statements/class/fielddefinition-initializer-abrupt-completion.js # test/language/statements/class/super-fielddefinition-initializer-abrupt-completion.js --- ...atic-classelementname-abrupt-completion.js | 42 +++++++++++++++++++ ...efinition-initializer-abrupt-completion.js | 42 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 test/language/statements/class/static-classelementname-abrupt-completion.js create mode 100644 test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js diff --git a/test/language/statements/class/static-classelementname-abrupt-completion.js b/test/language/statements/class/static-classelementname-abrupt-completion.js new file mode 100644 index 0000000000..d86d1f30d8 --- /dev/null +++ b/test/language/statements/class/static-classelementname-abrupt-completion.js @@ -0,0 +1,42 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Class definition should error if evaluation of static ClassElementName errors +esid: runtime-semantics-class-definition-evaluation +info: | + Runtime Semantics: ClassDefinitionEvaluation + ... + 27. For each ClassElement e in order from elements + a. If IsStatic of e is false, then + i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). + + Runtime Semantics: ClassElementEvaluation + ... + ClassElement : static FieldDefinition ; + 1. Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + Runtime Semantics: ClassFieldDefinitionEvaluation + With parameters isStatic and homeObject. + FieldDefinition : ClassElementNameInitializer + 1. Let fieldName be the result of evaluating ClassElementName. + 2. ReturnIfAbrupt(fieldName). + +features: [class-fields] +---*/ + +function f() { + throw new Test262Error(); +} + +assert.throws(Test262Error, function() { + class C { + static [f()] + } +}); diff --git a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js new file mode 100644 index 0000000000..226586d8b7 --- /dev/null +++ b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js @@ -0,0 +1,42 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Class construction should error if evaluation of static field initializer errors +esid: runtime-semantics-class-definition-evaluation +info: | + Runtime Semantics: ClassDefinitionEvaluation + ... + 33. Let result be InitializeStaticFields(F). + 34. If result is an abrupt completion, then + a. Set the running execution context's LexicalEnvironment to lex. + b. Return Completion(result). + + InitializeStaticFields(F) + 1. Assert: Type(F) is Object. + 2. Assert: F is an ECMAScript function object. + 3. Let fieldRecords be the value of F's [[Fields]] internal slot. + 4. For each item fieldRecord in order from fieldRecords, + a. If fieldRecord.[[static]] is true, then + i. Perform ? DefineField(F, fieldRecord). + + DefineField(receiver, fieldRecord) + 1. Assert: Type(receiver) is Object. + 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation. + 3. Let fieldName be fieldRecord.[[Name]]. + 4. Let initializer be fieldRecord.[[Initializer]]. + 5. If initializer is not empty, then + a. Let initValue be ? Call(initializer, receiver). + +features: [class-fields] +---*/ + +function f() { + throw new Test262Error(); +} + +assert.throws(Test262Error, function() { + class C { + static x = f(); + } +}) From 90e8859cddadde9ca94dceeb289768c4384b67be Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 17:15:03 -0400 Subject: [PATCH 08/40] Class Fields: Updating frontmatter --- .../class/privatefieldadd-typeerror.js | 5 +-- .../class/privatefieldget-success-1.js | 12 +++---- .../class/privatefieldget-success-2.js | 12 +++---- .../class/privatefieldget-success-3.js | 12 +++---- .../class/privatefieldget-success-4.js | 12 +++---- .../class/privatefieldget-success-5.js | 12 +++---- .../class/privatefieldget-typeerror-1.js | 12 +++---- .../class/privatefieldget-typeerror-2.js | 12 +++---- .../class/privatefieldget-typeerror-3.js | 12 +++---- .../class/privatefieldset-typeerror-1.js | 2 +- .../class/privatefieldset-typeerror-2.js | 2 +- .../class/privatefieldset-typeerror-3.js | 2 +- .../class/privatefieldset-typeerror-4.js | 2 +- .../class/privatefieldset-typeerror-5.js | 2 +- ...privatename-not-valid-earlyerr-script-1.js | 8 ++--- ...privatename-not-valid-earlyerr-script-2.js | 8 ++--- ...privatename-not-valid-earlyerr-script-3.js | 8 ++--- ...privatename-not-valid-earlyerr-script-4.js | 8 ++--- ...privatename-not-valid-earlyerr-script-5.js | 8 ++--- ...privatename-not-valid-earlyerr-script-6.js | 8 ++--- ...privatename-not-valid-earlyerr-script-7.js | 8 ++--- ...privatename-not-valid-earlyerr-script-8.js | 8 ++--- .../privatename-not-valid-eval-earlyerr-1.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-2.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-3.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-4.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-5.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-6.js | 13 +++---- .../privatename-not-valid-eval-earlyerr-7.js | 7 ++-- .../privatename-not-valid-eval-earlyerr-8.js | 7 ++-- .../class/privatename-valid-no-earlyerr.js | 13 +++---- ...atic-classelementname-abrupt-completion.js | 25 +++++-------- ...efinition-initializer-abrupt-completion.js | 35 +++++++------------ 33 files changed, 145 insertions(+), 195 deletions(-) diff --git a/test/language/statements/class/privatefieldadd-typeerror.js b/test/language/statements/class/privatefieldadd-typeerror.js index a22d0536c7..e127521932 100644 --- a/test/language/statements/class/privatefieldadd-typeerror.js +++ b/test/language/statements/class/privatefieldadd-typeerror.js @@ -19,8 +19,8 @@ info: | 2. Assert: Assert constructor is an ECMAScript function object. 3. Let fieldRecords be the value of constructor's [[Fields]] internal slot. 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is false, then - i. Perform ? DefineField(O, fieldRecord). + a. Perform ? DefineField(O, fieldRecord). + 5. Return. DefineField(receiver, fieldRecord) ... @@ -32,6 +32,7 @@ info: | 2. If O is not an object, throw a TypeError exception. 3. Let entry be PrivateFieldFind(P, O). 4. If entry is not empty, throw a TypeError exception. + ... features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatefieldget-success-1.js b/test/language/statements/class/privatefieldget-success-1.js index 834d6c876a..385ff09c9f 100644 --- a/test/language/statements/class/privatefieldget-success-1.js +++ b/test/language/statements/class/privatefieldget-success-1.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-success-2.js b/test/language/statements/class/privatefieldget-success-2.js index a404985e22..d5e091012c 100644 --- a/test/language/statements/class/privatefieldget-success-2.js +++ b/test/language/statements/class/privatefieldget-success-2.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-success-3.js b/test/language/statements/class/privatefieldget-success-3.js index 9b6104eabc..0dd43e38a9 100644 --- a/test/language/statements/class/privatefieldget-success-3.js +++ b/test/language/statements/class/privatefieldget-success-3.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-success-4.js b/test/language/statements/class/privatefieldget-success-4.js index b6c296afb3..7466fb4db2 100644 --- a/test/language/statements/class/privatefieldget-success-4.js +++ b/test/language/statements/class/privatefieldget-success-4.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-success-5.js b/test/language/statements/class/privatefieldget-success-5.js index 64c0ad5511..1dc9700e8e 100644 --- a/test/language/statements/class/privatefieldget-success-5.js +++ b/test/language/statements/class/privatefieldget-success-5.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-typeerror-1.js b/test/language/statements/class/privatefieldget-typeerror-1.js index d90c45efae..9cc17bf3d5 100644 --- a/test/language/statements/class/privatefieldget-typeerror-1.js +++ b/test/language/statements/class/privatefieldget-typeerror-1.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-typeerror-2.js b/test/language/statements/class/privatefieldget-typeerror-2.js index 3594f41021..a06439748b 100644 --- a/test/language/statements/class/privatefieldget-typeerror-2.js +++ b/test/language/statements/class/privatefieldget-typeerror-2.js @@ -8,12 +8,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldget-typeerror-3.js b/test/language/statements/class/privatefieldget-typeerror-3.js index f9669a6610..542e38097c 100644 --- a/test/language/statements/class/privatefieldget-typeerror-3.js +++ b/test/language/statements/class/privatefieldget-typeerror-3.js @@ -9,12 +9,12 @@ info: | GetValue ( V ) ... 5. If IsPropertyReference(V), then - ... - b. If IsPrivateReference(V), then - i. Let env be the running execution context's PrivateNameEnvironment. - ii. Let field be ? ResolveBinding(GetReferencedName(V), env). - iii. Assert: field is a Private Name. - iv. Return ? PrivateFieldGet(field, base). + ... + b. If IsPrivateReference(V), then + i. Let env be the running execution context's PrivateNameEnvironment. + ii. Let field be ? ResolveBinding(GetReferencedName(V), env). + iii. Assert: field is a Private Name. + iv. Return ? PrivateFieldGet(field, base). PrivateFieldGet (P, O ) 1. Assert: P is a Private Name value. diff --git a/test/language/statements/class/privatefieldset-typeerror-1.js b/test/language/statements/class/privatefieldset-typeerror-1.js index 8ad4492c06..01fc83c2db 100644 --- a/test/language/statements/class/privatefieldset-typeerror-1.js +++ b/test/language/statements/class/privatefieldset-typeerror-1.js @@ -7,7 +7,7 @@ esid: sec-putvalue info: | PutValue ( V, W ) ... - 5. Else if IsPropertyReference(V), then + 6. Else if IsPropertyReference(V), then ... b. If IsPrivateReference(V), then i. Let env be the running execution context's PrivateNameEnvironment. diff --git a/test/language/statements/class/privatefieldset-typeerror-2.js b/test/language/statements/class/privatefieldset-typeerror-2.js index a4054aaf68..e64451445b 100644 --- a/test/language/statements/class/privatefieldset-typeerror-2.js +++ b/test/language/statements/class/privatefieldset-typeerror-2.js @@ -7,7 +7,7 @@ esid: sec-putvalue info: | PutValue ( V, W ) ... - 5. Else if IsPropertyReference(V), then + 6. Else if IsPropertyReference(V), then ... b. If IsPrivateReference(V), then i. Let env be the running execution context's PrivateNameEnvironment. diff --git a/test/language/statements/class/privatefieldset-typeerror-3.js b/test/language/statements/class/privatefieldset-typeerror-3.js index 3f64d3eb74..656e8e3490 100644 --- a/test/language/statements/class/privatefieldset-typeerror-3.js +++ b/test/language/statements/class/privatefieldset-typeerror-3.js @@ -8,7 +8,7 @@ esid: sec-putvalue info: | PutValue ( V, W ) ... - 5. Else if IsPropertyReference(V), then + 6. Else if IsPropertyReference(V), then ... b. If IsPrivateReference(V), then i. Let env be the running execution context's PrivateNameEnvironment. diff --git a/test/language/statements/class/privatefieldset-typeerror-4.js b/test/language/statements/class/privatefieldset-typeerror-4.js index 0520bff461..20eff276e5 100644 --- a/test/language/statements/class/privatefieldset-typeerror-4.js +++ b/test/language/statements/class/privatefieldset-typeerror-4.js @@ -7,7 +7,7 @@ esid: sec-putvalue info: | PutValue ( V, W ) ... - 5. Else if IsPropertyReference(V), then + 6. Else if IsPropertyReference(V), then ... b. If IsPrivateReference(V), then i. Let env be the running execution context's PrivateNameEnvironment. diff --git a/test/language/statements/class/privatefieldset-typeerror-5.js b/test/language/statements/class/privatefieldset-typeerror-5.js index 5cc2402896..e8703f5c69 100644 --- a/test/language/statements/class/privatefieldset-typeerror-5.js +++ b/test/language/statements/class/privatefieldset-typeerror-5.js @@ -7,7 +7,7 @@ esid: sec-putvalue info: | PutValue ( V, W ) ... - 5. Else if IsPropertyReference(V), then + 6. Else if IsPropertyReference(V), then ... b. If IsPrivateReference(V), then i. Let env be the running execution context's PrivateNameEnvironment. diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-1.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-1.js index a617f44b9e..f1cb3d47c6 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-1.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-1.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename in constructor without being declared in class fields info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-2.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-2.js index a2583a3987..5a4b1c125f 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-2.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-2.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename in function in class without declaring in field info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-3.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-3.js index 18e0feaa41..67f7aaf50e 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-3.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-3.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename that has not been declared in class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private, class-fields-public] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-4.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-4.js index 728b669ae0..1c7553efa3 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-4.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-4.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename that has not been declared in class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-5.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-5.js index e5ed92bcee..f9a9bd414c 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-5.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-5.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename outside of class info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-6.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-6.js index 5901158cfa..f1a4f8ca86 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-6.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-6.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename outside of class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js index 185ddb54df..58c14e57dc 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename on object, outside of class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js index 6b6e963748..c134b47409 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js @@ -5,10 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename on object, outside of class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class-fields-private] negative: phase: parse diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-1.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-1.js index 44a3f94835..0da3536a98 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-1.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-1.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename in constructor without being declared in class fields info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-2.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-2.js index 69ea3b5432..434e1345c4 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-2.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-2.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename in function in class without declaring in field info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-3.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-3.js index be2283ccb2..dbfeef0d3a 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-3.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-3.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename that has not been declared in class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private, class-fields-public] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-4.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-4.js index 78395d58da..513999ebc3 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-4.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-4.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename that has not been declared in class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-5.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-5.js index 5572340e67..b3a7bf5a17 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-5.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-5.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename outside of class info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-6.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-6.js index cb50fa1912..1026d9271d 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-6.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-6.js @@ -5,15 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename outside of class. info: | Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - 2. If Script is parsed directly from PerformEval, - a. Let env be the running execution context's PrivateNameEnvironment. - b. Repeat while env is not null, - i. For each binding named N in env, - 1. If names does not contain N, append N to names. - ii. Let env be env's outer environment reference. - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class, class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-7.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-7.js index 972a395c8e..a5dee6c068 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-7.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-7.js @@ -5,9 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename on object, outside of class. info: | Static Semantics: Early Errors - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-not-valid-eval-earlyerr-8.js b/test/language/statements/class/privatename-not-valid-eval-earlyerr-8.js index b433d6a6d3..fc1ca835e2 100644 --- a/test/language/statements/class/privatename-not-valid-eval-earlyerr-8.js +++ b/test/language/statements/class/privatename-not-valid-eval-earlyerr-8.js @@ -5,9 +5,10 @@ esid: sec-scripts-static-semantics-early-errors description: Early error when referencing privatename on object, outside of class. info: | Static Semantics: Early Errors - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. + 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. + features: [class-fields-private] ---*/ diff --git a/test/language/statements/class/privatename-valid-no-earlyerr.js b/test/language/statements/class/privatename-valid-no-earlyerr.js index 85efc04213..7d3f1f52b7 100644 --- a/test/language/statements/class/privatename-valid-no-earlyerr.js +++ b/test/language/statements/class/privatename-valid-no-earlyerr.js @@ -1,16 +1,11 @@ // Copyright (C) 2017 Valerie Young. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -esid: sec-scripts-static-semantics-early-errors +esid: sec-all-private-names-valid description: Referencing privatename in class within class does not error. info: | - Static Semantics: Early Errors - Script : ScriptBody - 1. Let names be an empty List. - ... - 3. If AllPrivateNamesValid of ScriptBody with the argument names is false, throw a SyntaxError exception. - Static Semantics: AllPrivateNamesValid + AllPrivateNamesValid is an abstract operation which takes names as an argument. MemberExpression : MemberExpression . PrivateName @@ -21,9 +16,9 @@ info: | 1. If StringValue of PrivateName is in names, return true. 2. Return false. - ClassBody:ClassElementList + ClassBody : ClassElementList 1. Let newNames be the concatenation of names with PrivateBoundNames of ClassBody. - 2.Return AllPrivateNamesValid of ClassElementList with the argument newNames. + 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. diff --git a/test/language/statements/class/static-classelementname-abrupt-completion.js b/test/language/statements/class/static-classelementname-abrupt-completion.js index d86d1f30d8..e173f44330 100644 --- a/test/language/statements/class/static-classelementname-abrupt-completion.js +++ b/test/language/statements/class/static-classelementname-abrupt-completion.js @@ -9,26 +9,17 @@ info: | ... 27. For each ClassElement e in order from elements a. If IsStatic of e is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + i. Let fields be the result of performing ClassElementEvaluation + for e with arguments proto and false. b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + i. Let fields be the result of performing ClassElementEvaluation + for e with arguments F and false. c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). - Runtime Semantics: ClassElementEvaluation - ... - ClassElement : static FieldDefinition ; - 1. Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - FieldDefinition : ClassElementNameInitializer - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - -features: [class-fields] +features: [class-static-fields-public] ---*/ function f() { diff --git a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js index 226586d8b7..616acd38c2 100644 --- a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js +++ b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js @@ -7,28 +7,19 @@ esid: runtime-semantics-class-definition-evaluation info: | Runtime Semantics: ClassDefinitionEvaluation ... - 33. Let result be InitializeStaticFields(F). - 34. If result is an abrupt completion, then - a. Set the running execution context's LexicalEnvironment to lex. - b. Return Completion(result). + 27. For each ClassElement e in order from elements + a. If IsStatic of e is false, then + i. Let fields be the result of performing ClassElementEvaluation + for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation + for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). - InitializeStaticFields(F) - 1. Assert: Type(F) is Object. - 2. Assert: F is an ECMAScript function object. - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - - DefineField(receiver, fieldRecord) - 1. Assert: Type(receiver) is Object. - 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation. - 3. Let fieldName be fieldRecord.[[Name]]. - 4. Let initializer be fieldRecord.[[Initializer]]. - 5. If initializer is not empty, then - a. Let initValue be ? Call(initializer, receiver). - -features: [class-fields] +features: [class-static-fields-public] ---*/ function f() { @@ -39,4 +30,4 @@ assert.throws(Test262Error, function() { class C { static x = f(); } -}) +}); From c72926a10779ea1157e5adebfb71471de5b2c07a Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 17:20:37 -0400 Subject: [PATCH 09/40] Features: add class-static-* feature names --- features.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features.txt b/features.txt index 07d42907ec..36ef5360ff 100644 --- a/features.txt +++ b/features.txt @@ -20,6 +20,12 @@ BigInt class-fields-public class-fields-private +# Static Class Fields & Methods: +# https://github.com/tc39/proposal-static-class-features/ +class-static-fields-public +class-static-fields-private +class-static-methods-private + # Promise.prototype.finally # https://github.com/tc39/proposal-promise-finally Promise.prototype.finally From ac7bc64e732b483c81f3b9f87fba9d1b641a99c3 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 17:21:21 -0400 Subject: [PATCH 10/40] Class Fields: Updating frontmatter in src/class-fields/*.case --- .../eval-err-contains-superproperty-2.case | 10 ++++++---- src/class-fields/private-names.case | 2 +- src/class-fields/static-private-names.case | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/class-fields/eval-err-contains-superproperty-2.case b/src/class-fields/eval-err-contains-superproperty-2.case index 33fa810bde..dc8adbcdef 100644 --- a/src/class-fields/eval-err-contains-superproperty-2.case +++ b/src/class-fields/eval-err-contains-superproperty-2.case @@ -2,13 +2,15 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: error if `super['x']` in StatementList of eval +desc: error if super['x'] in StatementList of eval info: | - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods - These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. diff --git a/src/class-fields/private-names.case b/src/class-fields/private-names.case index 9f839452c7..0300803790 100644 --- a/src/class-fields/private-names.case +++ b/src/class-fields/private-names.case @@ -15,7 +15,7 @@ info: | PrivateName PrivateName: - #IdentifierName + # IdentifierName template: productions features: [class-fields-private] ---*/ diff --git a/src/class-fields/static-private-names.case b/src/class-fields/static-private-names.case index 464b53a9e9..47e795e75f 100644 --- a/src/class-fields/static-private-names.case +++ b/src/class-fields/static-private-names.case @@ -15,7 +15,7 @@ info: | PrivateName PrivateName: - #IdentifierName + # IdentifierName template: default ---*/ From 3996741ca0dff3875e08c8f524d605f0be8d43c6 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 18:10:35 -0400 Subject: [PATCH 11/40] Class Fields: Remove templates that cause erroneous tests to be created. --- src/class-fields/propname-constructor.case | 18 -------- .../cls-decl-computed-name.template | 23 ---------- .../cls-decl-literal-name.template | 21 --------- .../cls-decl-string-name.template | 22 --------- .../cls-decl-variable-name.template | 22 --------- .../cls-expr-computed-name.template | 23 ---------- .../cls-expr-literal-name.template | 21 --------- .../cls-expr-string-name.template | 22 --------- .../cls-expr-variable-name.template | 22 --------- .../static-propname-constructor.case | 20 --------- .../static-propname-prototype.case | 20 --------- ...c-comp-name-init-err-contains-arguments.js | 35 +++++++++++++++ ...tatic-comp-name-init-err-contains-super.js | 28 ++++++++++++ ...tic-literal-init-err-contains-arguments.js | 34 ++++++++++++++ ...-static-literal-init-err-contains-super.js | 27 +++++++++++ ...tic-private-init-err-contains-arguments.js | 34 ++++++++++++++ ...-static-private-init-err-contains-super.js | 27 +++++++++++ .../class/fields-static-private-names.js | 45 +++++++++++++++++++ ...iteral-name-init-err-contains-arguments.js | 34 ++++++++++++++ ...ng-literal-name-init-err-contains-super.js | 27 +++++++++++ ...string-name-static-propname-constructor.js | 32 +++++++++++++ ...s-string-name-static-propname-prototype.js | 32 +++++++++++++ 22 files changed, 355 insertions(+), 234 deletions(-) delete mode 100644 src/class-fields/propname-constructor.case delete mode 100644 src/class-fields/propname-error/cls-decl-computed-name.template delete mode 100644 src/class-fields/propname-error/cls-decl-literal-name.template delete mode 100644 src/class-fields/propname-error/cls-decl-string-name.template delete mode 100644 src/class-fields/propname-error/cls-decl-variable-name.template delete mode 100644 src/class-fields/propname-error/cls-expr-computed-name.template delete mode 100644 src/class-fields/propname-error/cls-expr-literal-name.template delete mode 100644 src/class-fields/propname-error/cls-expr-string-name.template delete mode 100644 src/class-fields/propname-error/cls-expr-variable-name.template delete mode 100644 src/class-fields/static-propname-constructor.case delete mode 100644 src/class-fields/static-propname-prototype.case create mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-static-comp-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-static-literal-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-private-init-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-static-private-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-static-private-names.js create mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js create mode 100644 test/language/statements/class/fields-string-name-static-propname-constructor.js create mode 100644 test/language/statements/class/fields-string-name-static-propname-prototype.js diff --git a/src/class-fields/propname-constructor.case b/src/class-fields/propname-constructor.case deleted file mode 100644 index 5254d7bf9e..0000000000 --- a/src/class-fields/propname-constructor.case +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: class fields forbid PropName 'constructor' -info: | - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "constructor". -features: [class, class-fields-public] -template: propname-error ----*/ - -//- propname -constructor diff --git a/src/class-fields/propname-error/cls-decl-computed-name.template b/src/class-fields/propname-error/cls-decl-computed-name.template deleted file mode 100644 index 547750ae06..0000000000 --- a/src/class-fields/propname-error/cls-decl-computed-name.template +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-computed-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var x = "/*{ propname }*/"; -class C { - [x]; -} - -var c = new C(); - -assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); -assert.sameValue(C.hasOwnProperty("/*{ propname }*/"), false); diff --git a/src/class-fields/propname-error/cls-decl-literal-name.template b/src/class-fields/propname-error/cls-decl-literal-name.template deleted file mode 100644 index 2d5b355929..0000000000 --- a/src/class-fields/propname-error/cls-decl-literal-name.template +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-literal-name- -name: early error -- PropName of IdentifierName is forbidden value -negative: - type: SyntaxError - phase: parse -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - /*{ propname }*/; -} diff --git a/src/class-fields/propname-error/cls-decl-string-name.template b/src/class-fields/propname-error/cls-decl-string-name.template deleted file mode 100644 index a18b8dd136..0000000000 --- a/src/class-fields/propname-error/cls-decl-string-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-string-name- -name: early error -- PropName of StringLiteral is forbidden value -negative: - type: SyntaxError - phase: parse -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - '/*{ propname }*/'; -} diff --git a/src/class-fields/propname-error/cls-decl-variable-name.template b/src/class-fields/propname-error/cls-decl-variable-name.template deleted file mode 100644 index cbda5b8319..0000000000 --- a/src/class-fields/propname-error/cls-decl-variable-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-computed-variable-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var /*{ propname }*/ = 'foo'; -class C { - /*{ static }*/ [/*{ propname }*/]; -} - -var c = new C(); - -assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/src/class-fields/propname-error/cls-expr-computed-name.template b/src/class-fields/propname-error/cls-expr-computed-name.template deleted file mode 100644 index 2abdbb6d5b..0000000000 --- a/src/class-fields/propname-error/cls-expr-computed-name.template +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-computed-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var x = "/*{ propname }*/"; -var C = class { - [x]; -}; - -var c = new C(); -assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); - -assert.sameValue(C.hasOwnProperty("/*{ propname }*/"), false); diff --git a/src/class-fields/propname-error/cls-expr-literal-name.template b/src/class-fields/propname-error/cls-expr-literal-name.template deleted file mode 100644 index 6ef427ebd7..0000000000 --- a/src/class-fields/propname-error/cls-expr-literal-name.template +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-literal-name- -name: early error -- PropName of IdentifierName is forbidden -negative: - type: SyntaxError - phase: parse -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - /*{ propname }*/; -}; diff --git a/src/class-fields/propname-error/cls-expr-string-name.template b/src/class-fields/propname-error/cls-expr-string-name.template deleted file mode 100644 index 3cb9c27281..0000000000 --- a/src/class-fields/propname-error/cls-expr-string-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-string-name- -name: early error -- PropName of StringLiteral is forbidden -negative: - type: SyntaxError - phase: parse -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - '/*{ propname }*/'; -}; diff --git a/src/class-fields/propname-error/cls-expr-variable-name.template b/src/class-fields/propname-error/cls-expr-variable-name.template deleted file mode 100644 index 50b255197f..0000000000 --- a/src/class-fields/propname-error/cls-expr-variable-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-computed-variable-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var /*{ propname }*/ = 'foo'; -var C = class { - /*{ static }*/ [/*{ propname }*/]; -} - -var c = new C(); - -assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case deleted file mode 100644 index ff3d00af6a..0000000000 --- a/src/class-fields/static-propname-constructor.case +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: static class field forbid PropName 'constructor' -info: | - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -features: [class-fields] -template: propname-error ----*/ - -//- static -static -//- propname -constructor diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case deleted file mode 100644 index 99d85ff64a..0000000000 --- a/src/class-fields/static-propname-prototype.case +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: static class fields forbid PropName 'prototype' -info: | - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -features: [class-fields] -template: propname-error ----*/ - -//- static -static -//- propname -prototype diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js new file mode 100644 index 0000000000..666a41ca8b --- /dev/null +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = arguments; +} diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..12d148d613 --- /dev/null +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + static [x] = super(); +} diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js b/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js new file mode 100644 index 0000000000..cd4f184292 --- /dev/null +++ b/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = arguments; +} diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-super.js b/test/language/statements/class/fields-static-literal-init-err-contains-super.js new file mode 100644 index 0000000000..64334ba094 --- /dev/null +++ b/test/language/statements/class/fields-static-literal-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static x = super(); +} diff --git a/test/language/statements/class/fields-static-private-init-err-contains-arguments.js b/test/language/statements/class/fields-static-private-init-err-contains-arguments.js new file mode 100644 index 0000000000..dc4b9a96bd --- /dev/null +++ b/test/language/statements/class/fields-static-private-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-decl-fields-static-private-name.template +/*--- +description: Syntax error if `arguments` used in class field (static PrivateName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static #x = arguments; +} diff --git a/test/language/statements/class/fields-static-private-init-err-contains-super.js b/test/language/statements/class/fields-static-private-init-err-contains-super.js new file mode 100644 index 0000000000..19423553ea --- /dev/null +++ b/test/language/statements/class/fields-static-private-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-private-name.template +/*--- +description: Syntax error if `super()` used in class field (static PrivateName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static #x = super(); +} diff --git a/test/language/statements/class/fields-static-private-names.js b/test/language/statements/class/fields-static-private-names.js new file mode 100644 index 0000000000..4192939646 --- /dev/null +++ b/test/language/statements/class/fields-static-private-names.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-names.case +// - src/class-fields/default/cls-decl.template +/*--- +description: literal private names (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +info: | + ClassElement: + ... + static FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PrivateName + + PrivateName: + # IdentifierName + +---*/ + + +class C { + static #x; static #y +} + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js new file mode 100644 index 0000000000..c44b995641 --- /dev/null +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = arguments; +} diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..39cf2cb52a --- /dev/null +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'x' = super(); +} diff --git a/test/language/statements/class/fields-string-name-static-propname-constructor.js b/test/language/statements/class/fields-string-name-static-propname-constructor.js new file mode 100644 index 0000000000..7013df4a70 --- /dev/null +++ b/test/language/statements/class/fields-string-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-string-name.template +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + 'constructor'; +} diff --git a/test/language/statements/class/fields-string-name-static-propname-prototype.js b/test/language/statements/class/fields-string-name-static-propname-prototype.js new file mode 100644 index 0000000000..a054249ef4 --- /dev/null +++ b/test/language/statements/class/fields-string-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-string-name.template +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + 'prototype'; +} From 7bb3bfe7fdc1081e644fc66e39cf945bf93fbf9d Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 18:26:47 -0400 Subject: [PATCH 12/40] Class Fields: eval-err-contains-newcall.case => eval-err-contains-newtarget.case --- .../eval-err-contains-newcall.case | 28 ------------------- .../eval-err-contains-newtarget.case | 8 ++++-- 2 files changed, 6 insertions(+), 30 deletions(-) delete mode 100644 src/class-fields/eval-err-contains-newcall.case diff --git a/src/class-fields/eval-err-contains-newcall.case b/src/class-fields/eval-err-contains-newcall.case deleted file mode 100644 index 530988a5bd..0000000000 --- a/src/class-fields/eval-err-contains-newcall.case +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: error if `new.call` in StatementList of eval -info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - - Additional Early Error Rules for Eval Outside Functions - These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList - - It is a Syntax Error if StatementList Contains NewTarget. -features: [class, class-fields-public] -template: initializer-eval ----*/ - -//- initializer -new.call -//- earlyerror -SyntaxError -//- executionerror -SyntaxError diff --git a/src/class-fields/eval-err-contains-newtarget.case b/src/class-fields/eval-err-contains-newtarget.case index e396fb4fa1..ab0e6b4692 100644 --- a/src/class-fields/eval-err-contains-newtarget.case +++ b/src/class-fields/eval-err-contains-newtarget.case @@ -16,9 +16,13 @@ info: | ScriptBody:StatementList It is a Syntax Error if StatementList Contains NewTarget. -features: [class, class-fields-public, new.target] -template: initializer-eval-newtarget +features: [class, class-fields-public] +template: initializer-eval ---*/ //- initializer new.target +//- earlyerror +SyntaxError +//- executionerror +SyntaxError From 734544272be0824ff701d4328807d6afd93cc13f Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 18:35:07 -0400 Subject: [PATCH 13/40] Class Fields: convert propname-error into non-generated to avoid creating erroneous tests where restrictions do not align. --- ...elds-computed-name-propname-constructor.js | 19 ++++++----- ...mputed-name-static-propname-constructor.js | 31 ++++++++++++++++++ ...computed-name-static-propname-prototype.js | 32 +++++++++++++++++++ ...ields-literal-name-propname-constructor.js | 8 ++--- ...iteral-name-static-propname-constructor.js | 29 +++++++++++++++++ ...-literal-name-static-propname-prototype.js | 29 +++++++++++++++++ ...fields-string-name-propname-constructor.js | 8 ++--- ...string-name-static-propname-constructor.js | 30 +++++++++++++++++ ...s-string-name-static-propname-prototype.js | 30 +++++++++++++++++ ...elds-computed-name-propname-constructor.js | 13 +++++--- ...tatic-computed-var-propname-constructor.js | 31 ++++++++++++++++++ ...-static-computed-var-propname-prototype.js | 31 ++++++++++++++++++ ...mputed-name-static-propname-constructor.js | 30 +++++++++++++++++ ...computed-name-static-propname-prototype.js | 30 +++++++++++++++++ ...ields-literal-name-propname-constructor.js | 8 ++--- ...iteral-name-static-propname-constructor.js | 29 +++++++++++++++++ ...-literal-name-static-propname-prototype.js | 29 +++++++++++++++++ ...fields-string-name-propname-constructor.js | 8 ++--- ...string-name-static-propname-constructor.js | 12 +++---- ...s-string-name-static-propname-prototype.js | 12 +++---- 20 files changed, 400 insertions(+), 49 deletions(-) create mode 100644 test/language/expressions/class/fields-computed-name-static-propname-constructor.js create mode 100644 test/language/expressions/class/fields-computed-name-static-propname-prototype.js create mode 100644 test/language/expressions/class/fields-literal-name-static-propname-constructor.js create mode 100644 test/language/expressions/class/fields-literal-name-static-propname-prototype.js create mode 100644 test/language/expressions/class/fields-string-name-static-propname-constructor.js create mode 100644 test/language/expressions/class/fields-string-name-static-propname-prototype.js create mode 100644 test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js create mode 100644 test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js create mode 100644 test/language/statements/class/fields-computed-name-static-propname-constructor.js create mode 100644 test/language/statements/class/fields-computed-name-static-propname-prototype.js create mode 100644 test/language/statements/class/fields-literal-name-static-propname-constructor.js create mode 100644 test/language/statements/class/fields-literal-name-static-propname-prototype.js diff --git a/test/language/expressions/class/fields-computed-name-propname-constructor.js b/test/language/expressions/class/fields-computed-name-propname-constructor.js index 0240885ef8..0050e3a7e5 100644 --- a/test/language/expressions/class/fields-computed-name-propname-constructor.js +++ b/test/language/expressions/class/fields-computed-name-propname-constructor.js @@ -1,33 +1,32 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-computed-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] info: | Static Semantics: PropName ... ComputedPropertyName : [ AssignmentExpression ] Return empty. - + // This test file tests the following early error: Static Semantics: Early Errors ClassElement : FieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "constructor". + +negative: + phase: parse + type: SyntaxError + ---*/ +throw "Test262: This statement should not be evaluated."; var x = "constructor"; var C = class { [x]; }; - -var c = new C(); -assert.sameValue(c.hasOwnProperty("constructor"), true); - -assert.sameValue(C.hasOwnProperty("constructor"), false); diff --git a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js new file mode 100644 index 0000000000..748e3fb53f --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "constructor"; +var C = class { + static [x]; +}; diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js new file mode 100644 index 0000000000..3d374d8d00 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + + +var x = "prototype"; +var C = class { + static [x]; +}; diff --git a/test/language/expressions/class/fields-literal-name-propname-constructor.js b/test/language/expressions/class/fields-literal-name-propname-constructor.js index bbb618c1cd..fc3b3545e1 100644 --- a/test/language/expressions/class/fields-literal-name-propname-constructor.js +++ b/test/language/expressions/class/fields-literal-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-literal-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -14,7 +12,7 @@ info: | LiteralPropertyName : IdentifierName Return StringValue of IdentifierName. - + // This test file tests the following early error: Static Semantics: Early Errors diff --git a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js new file mode 100644 index 0000000000..fbfea2a7bd --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static constructor; +}; diff --git a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js new file mode 100644 index 0000000000..3599dd4450 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static prototype; +}; diff --git a/test/language/expressions/class/fields-string-name-propname-constructor.js b/test/language/expressions/class/fields-string-name-propname-constructor.js index 039c915a47..d88b246392 100644 --- a/test/language/expressions/class/fields-string-name-propname-constructor.js +++ b/test/language/expressions/class/fields-string-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors diff --git a/test/language/expressions/class/fields-string-name-static-propname-constructor.js b/test/language/expressions/class/fields-string-name-static-propname-constructor.js new file mode 100644 index 0000000000..08a0f7b890 --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'constructor'; +}; diff --git a/test/language/expressions/class/fields-string-name-static-propname-prototype.js b/test/language/expressions/class/fields-string-name-static-propname-prototype.js new file mode 100644 index 0000000000..43078702ca --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-prototype.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'prototype'; +}; diff --git a/test/language/statements/class/fields-computed-name-propname-constructor.js b/test/language/statements/class/fields-computed-name-propname-constructor.js index f528e03bd2..46e19b73a8 100644 --- a/test/language/statements/class/fields-computed-name-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-propname-constructor.js @@ -1,26 +1,29 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-computed-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] info: | Static Semantics: PropName ... ComputedPropertyName : [ AssignmentExpression ] Return empty. - + // This test file tests the following early error: Static Semantics: Early Errors ClassElement : FieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "constructor". +negative: + phase: parse + type: SyntaxError + ---*/ +throw "Test262: This statement should not be evaluated."; var x = "constructor"; class C { diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js new file mode 100644 index 0000000000..1963899949 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "constructor"; +class C { + static [x]; +} diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js new file mode 100644 index 0000000000..4186915a5f --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js @@ -0,0 +1,31 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +var x = "prototype"; +class C { + static [x]; +} diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js new file mode 100644 index 0000000000..218a01bfe5 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static ["constructor"]; +} diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js new file mode 100644 index 0000000000..32e416a369 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-static-fields-public] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : static FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +negative: + phase: parse + type: SyntaxError + +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + static ["prototype"]; +} diff --git a/test/language/statements/class/fields-literal-name-propname-constructor.js b/test/language/statements/class/fields-literal-name-propname-constructor.js index a09cc62f66..6145242373 100644 --- a/test/language/statements/class/fields-literal-name-propname-constructor.js +++ b/test/language/statements/class/fields-literal-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-literal-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -14,7 +12,7 @@ info: | LiteralPropertyName : IdentifierName Return StringValue of IdentifierName. - + // This test file tests the following early error: Static Semantics: Early Errors diff --git a/test/language/statements/class/fields-literal-name-static-propname-constructor.js b/test/language/statements/class/fields-literal-name-static-propname-constructor.js new file mode 100644 index 0000000000..bb27a99d4e --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-static-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static constructor; +} diff --git a/test/language/statements/class/fields-literal-name-static-propname-prototype.js b/test/language/statements/class/fields-literal-name-static-propname-prototype.js new file mode 100644 index 0000000000..9d18ad1e5a --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-static-fields-public] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static prototype; +} diff --git a/test/language/statements/class/fields-string-name-propname-constructor.js b/test/language/statements/class/fields-string-name-propname-constructor.js index 1cc9c51530..114b17b405 100644 --- a/test/language/statements/class/fields-string-name-propname-constructor.js +++ b/test/language/statements/class/fields-string-name-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-fields-public] -flags: [generated] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors diff --git a/test/language/statements/class/fields-string-name-static-propname-constructor.js b/test/language/statements/class/fields-string-name-static-propname-constructor.js index 7013df4a70..59349a8ad9 100644 --- a/test/language/statements/class/fields-string-name-static-propname-constructor.js +++ b/test/language/statements/class/fields-string-name-static-propname-constructor.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-constructor.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors -features: [class-fields] -flags: [generated] +features: [class, class-static-fields-public] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors @@ -28,5 +26,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - 'constructor'; + static 'constructor'; } diff --git a/test/language/statements/class/fields-string-name-static-propname-prototype.js b/test/language/statements/class/fields-string-name-static-propname-prototype.js index a054249ef4..aa56e8688a 100644 --- a/test/language/statements/class/fields-string-name-static-propname-prototype.js +++ b/test/language/statements/class/fields-string-name-static-propname-prototype.js @@ -1,11 +1,9 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/static-propname-prototype.case -// - src/class-fields/propname-error/cls-decl-string-name.template +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. /*--- description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) esid: sec-class-definitions-static-semantics-early-errors -features: [class-fields] -flags: [generated] +features: [class, class-static-fields-public] negative: phase: parse type: SyntaxError @@ -15,7 +13,7 @@ info: | LiteralPropertyName : StringLiteral Return the String value whose code units are the SV of the StringLiteral. - + // This test file tests the following early error: Static Semantics: Early Errors @@ -28,5 +26,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - 'prototype'; + static 'prototype'; } From 1466650ca34145562702bf91430b8596abb6a726 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 30 Jul 2018 18:44:24 -0400 Subject: [PATCH 14/40] Class Fields: add private name propname errors --- .../privatefields-propname-constructor.js | 22 +++++++++++++++++++ ...fields-string-name-propname-constructor.js | 22 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 test/language/statements/class/privatefields-propname-constructor.js create mode 100644 test/language/statements/class/privatefields-string-name-propname-constructor.js diff --git a/test/language/statements/class/privatefields-propname-constructor.js b/test/language/statements/class/privatefields-propname-constructor.js new file mode 100644 index 0000000000..1634ae2edc --- /dev/null +++ b/test/language/statements/class/privatefields-propname-constructor.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +negative: + phase: parse + type: SyntaxError +info: | + ClassElementName : PrivateName; + + It is a Syntax Error if StringValue of PrivateName is "#constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #constructor; +} diff --git a/test/language/statements/class/privatefields-string-name-propname-constructor.js b/test/language/statements/class/privatefields-string-name-propname-constructor.js new file mode 100644 index 0000000000..ab0700a5fc --- /dev/null +++ b/test/language/statements/class/privatefields-string-name-propname-constructor.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-private] +negative: + phase: parse + type: SyntaxError +info: | + ClassElementName : PrivateName; + + It is a Syntax Error if StringValue of PrivateName is "#constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + ["#constructor"]; +} From ad9fd16bd1368524f24a1c8fb27e283393058efc Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 31 Jul 2018 14:09:08 -0400 Subject: [PATCH 15/40] Class Fields: convert .js file to .case --- ...name-toprimitive-returns-noncallable.case} | 0 ...d-name-toprimitive-returns-nonobject.case} | 0 .../class/fields-static-private-fields.js | 45 +++++++++++++++++++ .../class/fields-static-private-methods.js | 45 +++++++++++++++++++ 4 files changed, 90 insertions(+) rename src/class-fields/{computed-name-toprimitive-returns-noncallable.js => computed-name-toprimitive-returns-noncallable.case} (100%) rename src/class-fields/{computed-name-toprimitive-returns-nonobject.js => computed-name-toprimitive-returns-nonobject.case} (100%) create mode 100644 test/language/statements/class/fields-static-private-fields.js create mode 100644 test/language/statements/class/fields-static-private-methods.js diff --git a/src/class-fields/computed-name-toprimitive-returns-noncallable.js b/src/class-fields/computed-name-toprimitive-returns-noncallable.case similarity index 100% rename from src/class-fields/computed-name-toprimitive-returns-noncallable.js rename to src/class-fields/computed-name-toprimitive-returns-noncallable.case diff --git a/src/class-fields/computed-name-toprimitive-returns-nonobject.js b/src/class-fields/computed-name-toprimitive-returns-nonobject.case similarity index 100% rename from src/class-fields/computed-name-toprimitive-returns-nonobject.js rename to src/class-fields/computed-name-toprimitive-returns-nonobject.case diff --git a/test/language/statements/class/fields-static-private-fields.js b/test/language/statements/class/fields-static-private-fields.js new file mode 100644 index 0000000000..a9b0611ee4 --- /dev/null +++ b/test/language/statements/class/fields-static-private-fields.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/default/cls-decl.template +/*--- +description: literal private names (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +info: | + ClassElement: + ... + static FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PrivateName + + PrivateName: + # IdentifierName + +---*/ + + +class C { + static #x; static #y +} + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-static-private-methods.js b/test/language/statements/class/fields-static-private-methods.js new file mode 100644 index 0000000000..3bf11c26da --- /dev/null +++ b/test/language/statements/class/fields-static-private-methods.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/default/cls-decl.template +/*--- +description: literal private names (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement: + ... + static FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PrivateName + + PrivateName: + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal +} + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); From ad446cae7de2d7c7409f4540e538f4d6f22b8550 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 31 Jul 2018 14:21:54 -0400 Subject: [PATCH 16/40] Class Fields: remove "class-fields-public" from .template (set in .case) class-fields-public doesn't apply to all tests that are generated from these templates --- src/class-fields/class-evaluation-error/cls-decl.template | 2 +- src/class-fields/class-evaluation-error/cls-expr.template | 2 +- src/class-fields/default/cls-decl.template | 2 +- src/class-fields/default/cls-expr.template | 2 +- src/class-fields/eval-err-contains-newtarget.case | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/class-fields/class-evaluation-error/cls-decl.template b/src/class-fields/class-evaluation-error/cls-decl.template index 6a77134e10..457f614994 100644 --- a/src/class-fields/class-evaluation-error/cls-decl.template +++ b/src/class-fields/class-evaluation-error/cls-decl.template @@ -4,7 +4,7 @@ /*--- path: language/statements/class/fields-evaluation-error- name: field definitions in a class declaration -features: [class, class-fields-public] +features: [class] esid: sec-runtime-semantics-classdefinitionevaluation ---*/ diff --git a/src/class-fields/class-evaluation-error/cls-expr.template b/src/class-fields/class-evaluation-error/cls-expr.template index 55735b5974..3a9ca73b89 100644 --- a/src/class-fields/class-evaluation-error/cls-expr.template +++ b/src/class-fields/class-evaluation-error/cls-expr.template @@ -4,7 +4,7 @@ /*--- path: language/expressions/class/fields-evaluation-error- name: field definitions in a class expression -features: [class, class-fields-public] +features: [class] esid: sec-runtime-semantics-classdefinitionevaluation ---*/ diff --git a/src/class-fields/default/cls-decl.template b/src/class-fields/default/cls-decl.template index 8acd1452b8..d37e18acb0 100644 --- a/src/class-fields/default/cls-decl.template +++ b/src/class-fields/default/cls-decl.template @@ -4,7 +4,7 @@ /*--- path: language/statements/class/fields- name: field definitions in a class declaration -features: [class, class-fields-public] +features: [class] esid: prod-FieldDefinition ---*/ diff --git a/src/class-fields/default/cls-expr.template b/src/class-fields/default/cls-expr.template index 1ea8cc02e1..fcf25c6259 100644 --- a/src/class-fields/default/cls-expr.template +++ b/src/class-fields/default/cls-expr.template @@ -4,7 +4,7 @@ /*--- path: language/expressions/class/fields- name: field definitions in a class expression -features: [class, class-fields-public] +features: [class] esid: prod-FieldDefinition ---*/ diff --git a/src/class-fields/eval-err-contains-newtarget.case b/src/class-fields/eval-err-contains-newtarget.case index ab0e6b4692..c3c88f4369 100644 --- a/src/class-fields/eval-err-contains-newtarget.case +++ b/src/class-fields/eval-err-contains-newtarget.case @@ -16,8 +16,8 @@ info: | ScriptBody:StatementList It is a Syntax Error if StatementList Contains NewTarget. -features: [class, class-fields-public] -template: initializer-eval +features: [class, new.target] +template: initializer-eval-newtarget ---*/ //- initializer From 192c8fd4f60f5a755466c73f9156518feda7014d Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 31 Jul 2018 14:23:58 -0400 Subject: [PATCH 17/40] Class Fields: features corrections --- .../delete-error/cls-expr-field-delete-covered.template | 2 +- .../initializer-error/cls-decl-fields-arrow-fnc.template | 2 +- .../initializer-error/cls-decl-fields-comp-name.template | 3 ++- .../initializer-error/cls-decl-fields-equality.template | 1 + .../cls-decl-fields-literal-name.template | 1 + .../cls-decl-fields-static-comp-name.template | 1 + .../cls-decl-fields-static-literal-name.template | 1 + .../cls-decl-fields-static-private-name.template | 1 + .../cls-decl-fields-static-string-literal-name.template | 1 + .../cls-decl-fields-string-literal-name.template | 1 + .../initializer-error/cls-decl-fields-ternary.template | 1 + .../initializer-error/cls-decl-fields-typeof.template | 1 + .../initializer-error/cls-expr-fields-arrow-fnc.template | 2 +- .../initializer-error/cls-expr-fields-comp-name.template | 1 + .../initializer-error/cls-expr-fields-equality.template | 1 + .../cls-expr-fields-literal-name.template | 1 + .../cls-expr-fields-static-comp-name.template | 1 + .../cls-expr-fields-static-literal-name.template | 1 + .../cls-expr-fields-static-private-name.template | 1 + .../cls-expr-fields-static-string-literal-name.template | 1 + .../cls-expr-fields-string-literal-name.template | 1 + .../initializer-error/cls-expr-fields-ternary.template | 1 + .../initializer-error/cls-expr-fields-typeof.template | 1 + .../cls-decl-fields-eval.template | 1 + .../cls-decl-fields-indirect-eval.template | 1 + .../cls-expr-fields-eval.template | 1 + .../cls-expr-fields-indirect-eval.template | 1 + .../cls-decl-fields-eval.template | 1 + .../cls-decl-fields-indirect-eval.template | 1 + .../cls-expr-fields-eval.template | 1 + .../cls-expr-fields-indirect-eval.template | 1 + .../cls-decl-fields-eval.template | 3 +-- .../cls-decl-fields-indirect-eval.template | 3 +-- .../cls-expr-fields-eval.template | 3 +-- .../cls-expr-fields-indirect-eval.template | 3 +-- .../cls-decl-fields-eval.template | 3 +-- .../cls-decl-fields-indirect-eval.template | 3 +-- .../cls-expr-fields-eval.template | 5 ++--- .../cls-expr-fields-indirect-eval.template | 5 ++--- .../initializer-eval-super/cls-decl-fields-eval.template | 6 +++--- .../cls-decl-fields-indirect-eval.template | 3 ++- .../initializer-eval-super/cls-expr-fields-eval.template | 8 ++++---- .../cls-expr-fields-indirect-eval.template | 8 ++++---- .../initializer-eval/cls-decl-fields-eval.template | 3 ++- .../cls-decl-fields-indirect-eval.template | 3 ++- .../initializer-eval/cls-expr-fields-eval.template | 3 ++- .../cls-expr-fields-indirect-eval.template | 5 +++-- 47 files changed, 64 insertions(+), 39 deletions(-) diff --git a/src/class-fields/delete-error/cls-expr-field-delete-covered.template b/src/class-fields/delete-error/cls-expr-field-delete-covered.template index 776e068cb7..9e78934009 100644 --- a/src/class-fields/delete-error/cls-expr-field-delete-covered.template +++ b/src/class-fields/delete-error/cls-expr-field-delete-covered.template @@ -13,7 +13,7 @@ info: | 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. -features: [class, class-fields-private] +features: [class, class-fields-private, class-fields-public] negative: type: SyntaxError phase: parse diff --git a/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template b/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template index 308297a34a..023d337475 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template +++ b/src/class-fields/initializer-error/cls-decl-fields-arrow-fnc.template @@ -5,7 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-arrow-fnc- name: arrow function expression -features: [arrow-function] +features: [arrow-function, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template index a922c25b80..0bdf663715 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template @@ -5,11 +5,12 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-comp-name- name: computed ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; var x = "string"; class C { - static [x] = /*{ initializer }*/; + [x] = /*{ initializer }*/; } diff --git a/src/class-fields/initializer-error/cls-decl-fields-equality.template b/src/class-fields/initializer-error/cls-decl-fields-equality.template index 0e5b643e11..7db487e9c2 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-equality.template +++ b/src/class-fields/initializer-error/cls-decl-fields-equality.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-equality- name: equality expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-literal-name.template index 62060229fa..81cfb27add 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-literal-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-literal-name- name: literal ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template index b4eb238479..fe3e30a682 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-static-comp-name- name: static computed ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template index 335d76793f..87b8ad64cf 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-static-literal- name: static literal ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template index c50194b6a5..101b1213f1 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-static-private- name: static PrivateName +features: [class, class-static-fields-private] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template index 5fd801e187..041e2add89 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-static-string-literal-name- name: static string literal ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template index b76e487109..61fa803204 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template +++ b/src/class-fields/initializer-error/cls-decl-fields-string-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-string-literal-name- name: string literal ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-ternary.template b/src/class-fields/initializer-error/cls-decl-fields-ternary.template index db729e59c8..400753f2d0 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-ternary.template +++ b/src/class-fields/initializer-error/cls-decl-fields-ternary.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-ternary- name: ternary expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-decl-fields-typeof.template b/src/class-fields/initializer-error/cls-decl-fields-typeof.template index 86f5598b3b..a634372c0c 100644 --- a/src/class-fields/initializer-error/cls-decl-fields-typeof.template +++ b/src/class-fields/initializer-error/cls-decl-fields-typeof.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/statements/class/fields-typeof- name: typeof expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template b/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template index 0f20b4d9f8..1a2ad62b29 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template +++ b/src/class-fields/initializer-error/cls-expr-fields-arrow-fnc.template @@ -5,7 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-arrow-fnc- name: arrow function expression -features: [arrow-function] +features: [arrow-function, class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-comp-name.template index fea438412f..a9e1c2bfc4 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-comp-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-comp-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-comp-name- name: computed ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-equality.template b/src/class-fields/initializer-error/cls-expr-fields-equality.template index 2946f8004d..6f393cc360 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-equality.template +++ b/src/class-fields/initializer-error/cls-expr-fields-equality.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-equality- name: equality expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-literal-name.template index 891e285274..98250305d8 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-literal-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-literal-name- name: literal ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template index cb44207f4e..2ad6b7b348 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-static-comp-name- name: static computed ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template index 0a840e01ef..57d2960335 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-static-literal- name: static literal ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template index 0d3c770f9b..794d6bf6e9 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-static-private- name: static PrivateName +features: [class, class-static-fields-private] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template index deed9b15e3..0604760524 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-static-string-literal-name- name: static string literal ClassElementName +features: [class, class-static-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template index 1325036c0c..ebe9845376 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template +++ b/src/class-fields/initializer-error/cls-expr-fields-string-literal-name.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-string-literal-name- name: string literal ClassElementName +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-ternary.template b/src/class-fields/initializer-error/cls-expr-fields-ternary.template index 8dd67bed29..0abd1e4747 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-ternary.template +++ b/src/class-fields/initializer-error/cls-expr-fields-ternary.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-ternary- name: ternary expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-error/cls-expr-fields-typeof.template b/src/class-fields/initializer-error/cls-expr-fields-typeof.template index ec75561623..51f54036a8 100644 --- a/src/class-fields/initializer-error/cls-expr-fields-typeof.template +++ b/src/class-fields/initializer-error/cls-expr-fields-typeof.template @@ -5,6 +5,7 @@ esid: sec-class-definitions-static-semantics-early-errors path: language/expressions/class/fields-typeof- name: typeof expression +features: [class, class-fields-public] ---*/ throw "Test262: This statement should not be evaluated."; diff --git a/src/class-fields/initializer-eval-arguments/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-arguments/cls-decl-fields-eval.template index f75aa39e08..90859a8a9a 100644 --- a/src/class-fields/initializer-eval-arguments/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval-arguments/cls-decl-fields-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template index 0b795b6e7f..b08b5ee379 100644 --- a/src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-arguments/cls-decl-fields-indirect-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-arguments/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-arguments/cls-expr-fields-eval.template index a8acc6317b..6afff75bc9 100644 --- a/src/class-fields/initializer-eval-arguments/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval-arguments/cls-expr-fields-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-arguments/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-arguments/cls-expr-fields-indirect-eval.template index 8a37149a33..d6064ff6cb 100644 --- a/src/class-fields/initializer-eval-arguments/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-arguments/cls-expr-fields-indirect-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-newtarget/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-newtarget/cls-decl-fields-eval.template index 8ef1ea4d36..fce4c331aa 100644 --- a/src/class-fields/initializer-eval-newtarget/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval-newtarget/cls-decl-fields-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-newtarget/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-newtarget/cls-decl-fields-indirect-eval.template index ee4630ca19..57db803472 100644 --- a/src/class-fields/initializer-eval-newtarget/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-newtarget/cls-decl-fields-indirect-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-newtarget/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-newtarget/cls-expr-fields-eval.template index 1c6b4b438b..bdadf99c0b 100644 --- a/src/class-fields/initializer-eval-newtarget/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval-newtarget/cls-expr-fields-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template index 1c8bbf5979..0acfccf7df 100644 --- a/src/class-fields/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-newtarget/cls-expr-fields-indirect-eval.template @@ -5,6 +5,7 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template index 8ec98eac91..53579b49d3 100644 --- a/src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-decl-fields-eval.template @@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-direct- name: direct eval ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template index 0f9a97c6eb..ad0bf241de 100644 --- a/src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template @@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-indirect- name: indirect eval ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template index 65ab9d8dbd..1c9716a7a9 100644 --- a/src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-expr-fields-eval.template @@ -7,9 +7,8 @@ path: language/expressions/class/fields-derived-cls-direct- name: direct eval ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template index 83415b3df4..28f8bfe58b 100644 --- a/src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-expr-fields-indirect-eval.template @@ -7,9 +7,8 @@ path: language/expressions/class/fields-derived-cls-indirect- name: indirect eval ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template index a994b1e45c..52b0180ab8 100644 --- a/src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template @@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-direct- name: direct eval ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template index 0f9a97c6eb..ad0bf241de 100644 --- a/src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template @@ -7,9 +7,8 @@ path: language/statements/class/fields-derived-cls-indirect- name: indirect eval ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template index b7ca546beb..61bb0eeb75 100644 --- a/src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template @@ -7,12 +7,11 @@ path: language/expressions/class/fields-derived-cls-direct- name: direct eval ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; /*{ initializer }*/;'); -} +}; new C(); diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template index 83415b3df4..02db8f40f1 100644 --- a/src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template @@ -7,12 +7,11 @@ path: language/expressions/class/fields-derived-cls-indirect- name: indirect eval ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'); -} +}; assert.throws(SyntaxError, function() { new C(); diff --git a/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template b/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template index 101cf30b38..9c94c4f969 100644 --- a/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval-super/cls-decl-fields-eval.template @@ -5,12 +5,12 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-derived-cls-direct- name: direct eval +features: [class, class-fields-public] ---*/ -class A = {} - var executed = false; -class C extends A = { +class A = {} +class C extends A { x = eval('executed = true; /*{ initializer }*/;'; } diff --git a/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template index 9d77186bf2..98200556b6 100644 --- a/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template @@ -5,12 +5,13 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-derived-cls-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ class A = {} var executed = false; -class C extends A = { +class C extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'; } diff --git a/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template b/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template index 39597e8807..83a2632f7b 100644 --- a/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval-super/cls-expr-fields-eval.template @@ -5,14 +5,14 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-derived-cls-direct- name: direct eval +features: [class, class-fields-public] ---*/ -A = class {} - var executed = false; -C = class extends A { +var A = class {} +var C = class extends A { x = eval('executed = true; /*{ initializer }*/;'; -} +}; assert.throws(/*{ earlyerror }*/, function() { new C(); diff --git a/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template index 86db54edbc..2af99eb271 100644 --- a/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template @@ -5,14 +5,14 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-derived-cls-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ -A = class {} - var executed = false; -C = class extends A { +var A = class {} +var C = class extends A { x = (0, eval)('executed = true; /*{ initializer }*/;'; -} +}; assert.throws(/*{ executionerror }*/, function() { new C(); diff --git a/src/class-fields/initializer-eval/cls-decl-fields-eval.template b/src/class-fields/initializer-eval/cls-decl-fields-eval.template index ed721afebe..90859a8a9a 100644 --- a/src/class-fields/initializer-eval/cls-decl-fields-eval.template +++ b/src/class-fields/initializer-eval/cls-decl-fields-eval.template @@ -5,10 +5,11 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; -class C = { +class C { x = eval('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template index 11aa34d0da..b08b5ee379 100644 --- a/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template @@ -5,10 +5,11 @@ esid: sec-performeval-rules-in-initializer path: language/statements/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; -class C = { +class C { x = (0, eval)('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval/cls-expr-fields-eval.template b/src/class-fields/initializer-eval/cls-expr-fields-eval.template index 9915d0d098..6afff75bc9 100644 --- a/src/class-fields/initializer-eval/cls-expr-fields-eval.template +++ b/src/class-fields/initializer-eval/cls-expr-fields-eval.template @@ -5,10 +5,11 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-direct- name: direct eval +features: [class, class-fields-public] ---*/ var executed = false; -C = class { +var C = class { x = eval('executed = true; /*{ initializer }*/;'); } diff --git a/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template index d04a83dfb9..2716c4ace7 100644 --- a/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template @@ -5,12 +5,13 @@ esid: sec-performeval-rules-in-initializer path: language/expressions/class/fields-indirect- name: indirect eval +features: [class, class-fields-public] ---*/ var executed = false; -C = class { +var C = class { x = (0, eval)('executed = true; /*{ initializer }*/;'); -} +}; assert.throws(/*{ executionerror }*/, function() { new C(); From ba97c2a5ce833990f305ebd7037297c688b99ee5 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 31 Jul 2018 14:24:36 -0400 Subject: [PATCH 18/40] Class Fields: private fields variants --- .../cls-decl-private-fields-eval.template | 20 +++++++ ...decl-private-fields-indirect-eval.template | 20 +++++++ .../cls-expr-private-fields-eval.template | 20 +++++++ ...expr-private-fields-indirect-eval.template | 20 +++++++ .../cls-decl-private-fields-eval.template | 19 ++++++ ...decl-private-fields-indirect-eval.template | 20 +++++++ .../cls-expr-private-fields-eval.template | 19 ++++++ ...expr-private-fields-indirect-eval.template | 20 +++++++ .../cls-decl-private-fields-eval.template | 20 +++++++ ...decl-private-fields-indirect-eval.template | 20 +++++++ .../cls-expr-private-fields-eval.template | 20 +++++++ ...expr-private-fields-indirect-eval.template | 20 +++++++ .../cls-decl-private-fields-eval.template | 18 ++++++ ...decl-private-fields-indirect-eval.template | 20 +++++++ .../cls-expr-private-fields-eval.template | 18 ++++++ ...expr-private-fields-indirect-eval.template | 20 +++++++ .../cls-decl-private-fields-eval.template | 21 +++++++ ...decl-private-fields-indirect-eval.template | 22 +++++++ .../cls-expr-private-fields-eval.template | 21 +++++++ ...expr-private-fields-indirect-eval.template | 21 +++++++ .../cls-decl-private-fields-eval.template | 20 +++++++ ...decl-private-fields-indirect-eval.template | 20 +++++++ .../cls-expr-private-fields-eval.template | 20 +++++++ ...expr-private-fields-indirect-eval.template | 20 +++++++ ...-names.case => static-private-fields.case} | 0 src/class-fields/static-private-methods.case | 59 +++++++++++++++++++ 26 files changed, 538 insertions(+) create mode 100644 src/class-fields/initializer-eval-arguments/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-arguments/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-arguments/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-arguments/cls-expr-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval-super/cls-expr-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval/cls-decl-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval/cls-decl-private-fields-indirect-eval.template create mode 100644 src/class-fields/initializer-eval/cls-expr-private-fields-eval.template create mode 100644 src/class-fields/initializer-eval/cls-expr-private-fields-indirect-eval.template rename src/class-fields/{static-private-names.case => static-private-fields.case} (100%) create mode 100644 src/class-fields/static-private-methods.case diff --git a/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..27551d328b --- /dev/null +++ b/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..6a77ba9f22 --- /dev/null +++ b/src/class-fields/initializer-eval-arguments/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..656a7c81a0 --- /dev/null +++ b/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..4127bd1a86 --- /dev/null +++ b/src/class-fields/initializer-eval-arguments/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..14cdf6b266 --- /dev/null +++ b/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +var c = new C(); + +assert.sameValue(executed, true); +assert.sameValue(c.x, undefined); diff --git a/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..bb7eb64337 --- /dev/null +++ b/src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..3efe9eb6ee --- /dev/null +++ b/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-eval.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +var c = new C(); + +assert.sameValue(executed, true); +assert.sameValue(c.x, undefined); diff --git a/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..032852f7b3 --- /dev/null +++ b/src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..2b52bf407e --- /dev/null +++ b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-direct- +name: direct eval +---*/ + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..20c2d86156 --- /dev/null +++ b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..d1953958ec --- /dev/null +++ b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-direct- +name: direct eval +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..fef18bb5f1 --- /dev/null +++ b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..250b36d4c1 --- /dev/null +++ b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-direct- +name: direct eval +---*/ + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +new C(); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..20c2d86156 --- /dev/null +++ b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..b11847616d --- /dev/null +++ b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-direct- +name: direct eval +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; /*{ initializer }*/;'); +}; + +new C(); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..9a0aec624f --- /dev/null +++ b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-derived-cls-indirect- +name: indirect eval +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +}; + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-super/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..f536ad4266 --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-decl-private-fields-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-derived-cls-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class A = {} +class C extends A { + #x = eval('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..1b4adf525c --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-derived-cls-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +class A = {} + +var executed = false; +class C extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'; +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval-super/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-super/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..c55f04ad2e --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-expr-private-fields-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-derived-cls-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; /*{ initializer }*/;'; +}; + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval-super/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..5f22b7ac6f --- /dev/null +++ b/src/class-fields/initializer-eval-super/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-derived-cls-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; /*{ initializer }*/;'; +}; + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval/cls-decl-private-fields-eval.template new file mode 100644 index 0000000000..27551d328b --- /dev/null +++ b/src/class-fields/initializer-eval/cls-decl-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-decl-private-fields-indirect-eval.template new file mode 100644 index 0000000000..6a77ba9f22 --- /dev/null +++ b/src/class-fields/initializer-eval/cls-decl-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/statements/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +class C { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/initializer-eval/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval/cls-expr-private-fields-eval.template new file mode 100644 index 0000000000..656a7c81a0 --- /dev/null +++ b/src/class-fields/initializer-eval/cls-expr-private-fields-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-direct- +name: direct eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = eval('executed = true; /*{ initializer }*/;'); +} + +assert.throws(/*{ earlyerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/src/class-fields/initializer-eval/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval/cls-expr-private-fields-indirect-eval.template new file mode 100644 index 0000000000..ade5a57491 --- /dev/null +++ b/src/class-fields/initializer-eval/cls-expr-private-fields-indirect-eval.template @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-performeval-rules-in-initializer +path: language/expressions/class/fields-private-indirect- +name: indirect eval +features: [class, class-fields-private] +---*/ + +var executed = false; +var C = class { + #x = (0, eval)('executed = true; /*{ initializer }*/;'); +}; + +assert.throws(/*{ executionerror }*/, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/src/class-fields/static-private-names.case b/src/class-fields/static-private-fields.case similarity index 100% rename from src/class-fields/static-private-names.case rename to src/class-fields/static-private-fields.case diff --git a/src/class-fields/static-private-methods.case b/src/class-fields/static-private-methods.case new file mode 100644 index 0000000000..9675c9d8af --- /dev/null +++ b/src/class-fields/static-private-methods.case @@ -0,0 +1,59 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: literal private names +info: | + ClassElement: + ... + static FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PrivateName + + PrivateName: + # IdentifierName + +template: default +features: [class-static-methods-private] +---*/ + +//- fields +static #xVal; static #yVal +//- privateinspectionfunctions + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } + +//- assertions + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); From 0298174c06d3920bce9952e142d3515408ada89e Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 1 Aug 2018 11:22:55 -0400 Subject: [PATCH 19/40] Class Fields: minor updates to existing templates to improve output source --- .../eval-err-contains-newtarget.case | 3 +- .../eval-err-contains-supercall-1.case | 4 +- .../eval-err-contains-supercall-2.case | 2 +- .../eval-err-contains-supercall.case | 3 +- .../eval-err-contains-superproperty-1.case | 3 +- src/class-fields/private-names.case | 27 ++++++------ ...ls-decl-after-same-line-async-gen.template | 2 +- ...decl-after-same-line-async-method.template | 2 +- .../cls-decl-after-same-line-gen.template | 2 +- .../cls-decl-after-same-line-method.template | 2 +- ...-after-same-line-static-async-gen.template | 2 +- ...ter-same-line-static-async-method.template | 2 +- ...s-decl-after-same-line-static-gen.template | 2 +- ...ecl-after-same-line-static-method.template | 2 +- .../cls-decl-multiple-definitions.template | 2 +- ...decl-multiple-stacked-definitions.template | 2 +- .../cls-decl-new-no-sc-line-method.template | 2 +- .../cls-decl-new-sc-line-generator.template | 2 +- .../cls-decl-new-sc-line-method.template | 2 +- .../cls-decl-regular-definitions.template | 2 +- .../cls-decl-same-line-generator.template | 2 +- .../cls-decl-same-line-method.template | 2 +- .../cls-decl-wrapped-in-sc.template | 2 +- ...ls-expr-after-same-line-async-gen.template | 2 +- ...expr-after-same-line-async-method.template | 2 +- .../cls-expr-after-same-line-gen.template | 2 +- .../cls-expr-after-same-line-method.template | 2 +- ...-after-same-line-static-async-gen.template | 2 +- ...ter-same-line-static-async-method.template | 2 +- ...s-expr-after-same-line-static-gen.template | 2 +- ...xpr-after-same-line-static-method.template | 2 +- .../cls-expr-multiple-definitions.template | 2 +- ...expr-multiple-stacked-definitions.template | 2 +- .../cls-expr-new-no-sc-line-method.template | 2 +- .../cls-expr-new-sc-line-generator.template | 2 +- .../cls-expr-new-sc-line-method.template | 2 +- .../cls-expr-regular-definitions.template | 2 +- .../cls-expr-same-line-generator.template | 2 +- .../cls-expr-same-line-method.template | 2 +- .../cls-expr-wrapped-in-sc.template | 2 +- src/class-fields/static-private-fields.case | 30 +++++++------- src/class-fields/static-private-methods.case | 41 +++++++++---------- 42 files changed, 93 insertions(+), 88 deletions(-) diff --git a/src/class-fields/eval-err-contains-newtarget.case b/src/class-fields/eval-err-contains-newtarget.case index c3c88f4369..deb2e6c4f0 100644 --- a/src/class-fields/eval-err-contains-newtarget.case +++ b/src/class-fields/eval-err-contains-newtarget.case @@ -13,9 +13,10 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. + features: [class, new.target] template: initializer-eval-newtarget ---*/ diff --git a/src/class-fields/eval-err-contains-supercall-1.case b/src/class-fields/eval-err-contains-supercall-1.case index 5700ca64ee..e1a5370b03 100644 --- a/src/class-fields/eval-err-contains-supercall-1.case +++ b/src/class-fields/eval-err-contains-supercall-1.case @@ -13,16 +13,16 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. + features: [class, class-fields-public] template: initializer-eval-super-call ---*/ //- initializer super()['x'] - //- earlyerror SyntaxError //- executionerror diff --git a/src/class-fields/eval-err-contains-supercall-2.case b/src/class-fields/eval-err-contains-supercall-2.case index 1c6a7b00b7..0d0f937089 100644 --- a/src/class-fields/eval-err-contains-supercall-2.case +++ b/src/class-fields/eval-err-contains-supercall-2.case @@ -6,7 +6,7 @@ desc: error if `super().x` in StatementList of eval info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/src/class-fields/eval-err-contains-supercall.case b/src/class-fields/eval-err-contains-supercall.case index 9681120f08..89a012780c 100644 --- a/src/class-fields/eval-err-contains-supercall.case +++ b/src/class-fields/eval-err-contains-supercall.case @@ -13,9 +13,10 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. + features: [class, class-fields-public] template: initializer-eval-super-call ---*/ diff --git a/src/class-fields/eval-err-contains-superproperty-1.case b/src/class-fields/eval-err-contains-superproperty-1.case index 14706db8de..564ad5342f 100644 --- a/src/class-fields/eval-err-contains-superproperty-1.case +++ b/src/class-fields/eval-err-contains-superproperty-1.case @@ -13,9 +13,10 @@ info: | Additional Early Error Rules for Eval Outside Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. + features: [class, class-fields-public] template: initializer-eval-super-property ---*/ diff --git a/src/class-fields/private-names.case b/src/class-fields/private-names.case index 0300803790..3dcb1df325 100644 --- a/src/class-fields/private-names.case +++ b/src/class-fields/private-names.case @@ -2,20 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: static literal private names +desc: private names info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName + template: productions features: [class-fields-private] ---*/ @@ -23,14 +24,14 @@ features: [class-fields-private] //- fields #x; #y //- privateinspectionfunctions - x() { - this.#x = 42; - return this.#x; - } - y() { - this.#y = 43; - return this.#y; - } +x() { + this.#x = 42; + return this.#x; +} +y() { + this.#y = 43; + return this.#y; +} //- assertions // Test the private fields do not appear as properties before set to value diff --git a/src/class-fields/productions/cls-decl-after-same-line-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-async-gen.template index 7f6370a8f9..86112b8c1b 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-async-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-async-gen.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { async *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-async-method.template index 3f27b16f39..0c2e40f9c6 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-async-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-async-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { async m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-gen.template b/src/class-fields/productions/cls-decl-after-same-line-gen.template index 685e9a932c..386fa7a550 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-gen.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-method.template b/src/class-fields/productions/cls-decl-after-same-line-method.template index 03c468685b..c7716e45a5 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template index 4e9a9bbe9b..5f2527b231 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { static async *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template index df3ff3aca1..78d5c7ad6f 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { static async m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-gen.template b/src/class-fields/productions/cls-decl-after-same-line-static-gen.template index 68e5251f0d..0796e403bb 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-gen.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { static *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-method.template b/src/class-fields/productions/cls-decl-after-same-line-static-method.template index cce75d1726..a55ceddf84 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { static m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-multiple-definitions.template b/src/class-fields/productions/cls-decl-multiple-definitions.template index a64f7bc539..ea28963573 100644 --- a/src/class-fields/productions/cls-decl-multiple-definitions.template +++ b/src/class-fields/productions/cls-decl-multiple-definitions.template @@ -15,7 +15,7 @@ class C { /*{ fields }*/ m2() { return 39 } bar = "barbaz"; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-multiple-stacked-definitions.template b/src/class-fields/productions/cls-decl-multiple-stacked-definitions.template index e65c65475c..5f86b161c3 100644 --- a/src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +++ b/src/class-fields/productions/cls-decl-multiple-stacked-definitions.template @@ -13,7 +13,7 @@ class C { /*{ fields }*/ foo = "foobar" bar = "barbaz"; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-new-no-sc-line-method.template b/src/class-fields/productions/cls-decl-new-no-sc-line-method.template index bc7bedf155..e27900a084 100644 --- a/src/class-fields/productions/cls-decl-new-no-sc-line-method.template +++ b/src/class-fields/productions/cls-decl-new-no-sc-line-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { /*{ fields }*/ m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-new-sc-line-generator.template b/src/class-fields/productions/cls-decl-new-sc-line-generator.template index 3ae2f7ebaa..385d8cadde 100644 --- a/src/class-fields/productions/cls-decl-new-sc-line-generator.template +++ b/src/class-fields/productions/cls-decl-new-sc-line-generator.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { /*{ fields }*/; *m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-new-sc-line-method.template b/src/class-fields/productions/cls-decl-new-sc-line-method.template index 1bdd2ab6f7..fa55454f3f 100644 --- a/src/class-fields/productions/cls-decl-new-sc-line-method.template +++ b/src/class-fields/productions/cls-decl-new-sc-line-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] class C { /*{ fields }*/; m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-regular-definitions.template b/src/class-fields/productions/cls-decl-regular-definitions.template index 870e20b98b..5bb2f23b26 100644 --- a/src/class-fields/productions/cls-decl-regular-definitions.template +++ b/src/class-fields/productions/cls-decl-regular-definitions.template @@ -10,7 +10,7 @@ esid: prod-FieldDefinition class C { /*{ fields }*/ -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-same-line-generator.template b/src/class-fields/productions/cls-decl-same-line-generator.template index 467e259d84..0fa5df7f09 100644 --- a/src/class-fields/productions/cls-decl-same-line-generator.template +++ b/src/class-fields/productions/cls-decl-same-line-generator.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { /*{ fields }*/; *m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-same-line-method.template b/src/class-fields/productions/cls-decl-same-line-method.template index 7b1bd68cec..6974a01f70 100644 --- a/src/class-fields/productions/cls-decl-same-line-method.template +++ b/src/class-fields/productions/cls-decl-same-line-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] class C { /*{ fields }*/; m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-decl-wrapped-in-sc.template b/src/class-fields/productions/cls-decl-wrapped-in-sc.template index ccccf51d79..2f6db155a4 100644 --- a/src/class-fields/productions/cls-decl-wrapped-in-sc.template +++ b/src/class-fields/productions/cls-decl-wrapped-in-sc.template @@ -12,7 +12,7 @@ class C { ;;;; ;;;;;;/*{ fields }*/;;;;;;; ;;;; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template index 410d8abd6d..ce74f1e488 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-async-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { async *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-async-method.template index 60b81cb597..5159fb2431 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-async-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-async-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { async m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-gen.template b/src/class-fields/productions/cls-expr-after-same-line-gen.template index 8231e3eea4..5cfdedecf0 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-gen.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-method.template b/src/class-fields/productions/cls-expr-after-same-line-method.template index 5ea97ad696..c89fda4dd4 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template index 26df25c717..0a1cb27869 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { static async *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template index 84dad39280..ff00a66a60 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { static async m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-gen.template b/src/class-fields/productions/cls-expr-after-same-line-static-gen.template index 9d9c314705..2281b3bc79 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-gen.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { static *m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-method.template b/src/class-fields/productions/cls-expr-after-same-line-static-method.template index 922c449ffa..aa21b2ec29 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { static m() { return 42; } /*{ fields }*/; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-multiple-definitions.template b/src/class-fields/productions/cls-expr-multiple-definitions.template index c94b5255da..d98b741b84 100644 --- a/src/class-fields/productions/cls-expr-multiple-definitions.template +++ b/src/class-fields/productions/cls-expr-multiple-definitions.template @@ -15,7 +15,7 @@ var C = class { /*{ fields }*/ m2() { return 39 } bar = "barbaz"; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-multiple-stacked-definitions.template b/src/class-fields/productions/cls-expr-multiple-stacked-definitions.template index 8184c88058..cbb6f73300 100644 --- a/src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +++ b/src/class-fields/productions/cls-expr-multiple-stacked-definitions.template @@ -13,7 +13,7 @@ var C = class { /*{ fields }*/ foo = "foobar" bar = "barbaz"; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-new-no-sc-line-method.template b/src/class-fields/productions/cls-expr-new-no-sc-line-method.template index f0269c0f42..5755b501d0 100644 --- a/src/class-fields/productions/cls-expr-new-no-sc-line-method.template +++ b/src/class-fields/productions/cls-expr-new-no-sc-line-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { /*{ fields }*/ m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-new-sc-line-generator.template b/src/class-fields/productions/cls-expr-new-sc-line-generator.template index 34d080e3fc..0ab3f55e44 100644 --- a/src/class-fields/productions/cls-expr-new-sc-line-generator.template +++ b/src/class-fields/productions/cls-expr-new-sc-line-generator.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { /*{ fields }*/; *m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-new-sc-line-method.template b/src/class-fields/productions/cls-expr-new-sc-line-method.template index e604e4ee62..b0ae70949b 100644 --- a/src/class-fields/productions/cls-expr-new-sc-line-method.template +++ b/src/class-fields/productions/cls-expr-new-sc-line-method.template @@ -12,7 +12,7 @@ includes: [propertyHelper.js] var C = class { /*{ fields }*/; m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-regular-definitions.template b/src/class-fields/productions/cls-expr-regular-definitions.template index 3f1665d002..08a36b51cb 100644 --- a/src/class-fields/productions/cls-expr-regular-definitions.template +++ b/src/class-fields/productions/cls-expr-regular-definitions.template @@ -10,7 +10,7 @@ esid: prod-FieldDefinition var C = class { /*{ fields }*/ -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-same-line-generator.template b/src/class-fields/productions/cls-expr-same-line-generator.template index ca1fcdc8bc..b69692d68e 100644 --- a/src/class-fields/productions/cls-expr-same-line-generator.template +++ b/src/class-fields/productions/cls-expr-same-line-generator.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { /*{ fields }*/; *m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-same-line-method.template b/src/class-fields/productions/cls-expr-same-line-method.template index 78eee3d869..7d40e6d65b 100644 --- a/src/class-fields/productions/cls-expr-same-line-method.template +++ b/src/class-fields/productions/cls-expr-same-line-method.template @@ -11,7 +11,7 @@ includes: [propertyHelper.js] var C = class { /*{ fields }*/; m() { return 42; } -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/productions/cls-expr-wrapped-in-sc.template b/src/class-fields/productions/cls-expr-wrapped-in-sc.template index ff2780e2b2..c90df3c17a 100644 --- a/src/class-fields/productions/cls-expr-wrapped-in-sc.template +++ b/src/class-fields/productions/cls-expr-wrapped-in-sc.template @@ -12,7 +12,7 @@ var C = class { ;;;; ;;;;;;/*{ fields }*/;;;;;;; ;;;; -/*{ privateinspectionfunctions }*/ + /*{ privateinspectionfunctions }*/ } var c = new C(); diff --git a/src/class-fields/static-private-fields.case b/src/class-fields/static-private-fields.case index 47e795e75f..633046576b 100644 --- a/src/class-fields/static-private-fields.case +++ b/src/class-fields/static-private-fields.case @@ -2,34 +2,36 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: literal private names +desc: static private fields info: | - ClassElement: + ClassElement : ... static FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName -template: default + +template: productions +features: [class-static-fields-private] ---*/ //- fields static #x; static #y //- privateinspectionfunctions - static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } +static x() { + this.#x = 42; + return this.#x; +} +static y() { + this.#y = 43; + return this.#y; +} //- assertions // Test the private fields do not appear as properties before set to value diff --git a/src/class-fields/static-private-methods.case b/src/class-fields/static-private-methods.case index 9675c9d8af..50b6565f24 100644 --- a/src/class-fields/static-private-methods.case +++ b/src/class-fields/static-private-methods.case @@ -2,43 +2,42 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -desc: literal private names +desc: static private methods info: | - ClassElement: + ClassElement : ... static FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName -template: default +template: productions features: [class-static-methods-private] ---*/ //- fields static #xVal; static #yVal //- privateinspectionfunctions - static #x(value) { - this.#xVal = value; - return this.#xVal; - } - static #y(value) { - this.#y = value; - return this.#yVal; - } - static x() { - return this.#x(42); - } - static y() { - return this.#y(43); - } - +static #x(value) { + this.#xVal = value; + return this.#xVal; +} +static #y(value) { + this.#y = value; + return this.#yVal; +} +static x() { + return this.#x(42); +} +static y() { + return this.#y(43); +} //- assertions // Test the private methods do not appear as properties before set to value From f222b94f2a87033a54b97d5661ea3ef10ec16aa6 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 1 Aug 2018 14:20:57 -0400 Subject: [PATCH 20/40] Generate tests --- ...e-covered-member-expression-privatename.js | 2 +- ...elds-after-same-line-gen-computed-names.js | 2 +- ...ter-same-line-gen-computed-symbol-names.js | 2 +- ...ields-after-same-line-gen-literal-names.js | 2 +- ...ields-after-same-line-gen-private-names.js | 14 +-- ...ter-same-line-gen-static-private-fields.js | 66 +++++++++++ ...er-same-line-gen-static-private-methods.js | 72 ++++++++++++ ...fter-same-line-gen-string-literal-names.js | 2 +- ...s-after-same-line-method-computed-names.js | 2 +- ...-same-line-method-computed-symbol-names.js | 2 +- ...ds-after-same-line-method-literal-names.js | 2 +- ...ds-after-same-line-method-private-names.js | 14 +-- ...-same-line-method-static-private-fields.js | 66 +++++++++++ ...same-line-method-static-private-methods.js | 72 ++++++++++++ ...r-same-line-method-string-literal-names.js | 2 +- ...me-line-static-async-gen-computed-names.js | 2 +- ...-static-async-gen-computed-symbol-names.js | 2 +- ...ame-line-static-async-gen-literal-names.js | 2 +- ...ame-line-static-async-gen-private-names.js | 14 +-- ...-static-async-gen-static-private-fields.js | 70 ++++++++++++ ...static-async-gen-static-private-methods.js | 76 ++++++++++++ ...e-static-async-gen-string-literal-names.js | 2 +- ...line-static-async-method-computed-names.js | 2 +- ...atic-async-method-computed-symbol-names.js | 2 +- ...-line-static-async-method-literal-names.js | 2 +- ...-line-static-async-method-private-names.js | 14 +-- ...atic-async-method-static-private-fields.js | 69 +++++++++++ ...tic-async-method-static-private-methods.js | 75 ++++++++++++ ...tatic-async-method-string-literal-names.js | 2 +- ...ter-same-line-static-gen-computed-names.js | 2 +- ...e-line-static-gen-computed-symbol-names.js | 2 +- ...fter-same-line-static-gen-literal-names.js | 2 +- ...fter-same-line-static-gen-private-names.js | 14 +-- ...e-line-static-gen-static-private-fields.js | 66 +++++++++++ ...-line-static-gen-static-private-methods.js | 72 ++++++++++++ ...me-line-static-gen-string-literal-names.js | 2 +- ...-same-line-static-method-computed-names.js | 2 +- ...ine-static-method-computed-symbol-names.js | 2 +- ...r-same-line-static-method-literal-names.js | 2 +- ...r-same-line-static-method-private-names.js | 14 +-- ...ine-static-method-static-private-fields.js | 66 +++++++++++ ...ne-static-method-static-private-methods.js | 72 ++++++++++++ ...line-static-method-string-literal-names.js | 2 +- ...fields-computed-name-toprimitive-symbol.js | 2 +- .../class/fields-computed-name-toprimitive.js | 2 +- ...uted-variable-name-propname-constructor.js | 33 ------ .../fields-ctor-called-after-fields-init.js | 2 +- ...ls-direct-eval-err-contains-supercall-1.js | 3 +- ...ls-direct-eval-err-contains-supercall-2.js | 10 +- ...-cls-direct-eval-err-contains-supercall.js | 3 +- ...irect-eval-err-contains-superproperty-1.js | 5 +- ...irect-eval-err-contains-superproperty-2.js | 20 ++-- ...-indirect-eval-err-contains-supercall-1.js | 3 +- ...-indirect-eval-err-contains-supercall-2.js | 10 +- ...ls-indirect-eval-err-contains-supercall.js | 3 +- ...irect-eval-err-contains-superproperty-1.js | 5 +- ...irect-eval-err-contains-superproperty-2.js | 20 ++-- ...elds-direct-eval-err-contains-newtarget.js | 2 +- ...tion-error-computed-name-referenceerror.js | 2 +- ...ion-error-computed-name-toprimitive-err.js | 2 +- ...ed-name-toprimitive-returns-noncallable.js | 57 +++++++++ ...uted-name-toprimitive-returns-nonobject.js | 56 +++++++++ ...uation-error-computed-name-tostring-err.js | 2 +- ...luation-error-computed-name-valueof-err.js | 2 +- ...ds-indirect-eval-err-contains-newtarget.js | 2 +- .../class/fields-init-err-evaluation.js | 2 +- .../fields-init-value-defined-after-class.js | 2 +- .../class/fields-init-value-incremental.js | 2 +- ...lds-multiple-definitions-computed-names.js | 2 +- ...tiple-definitions-computed-symbol-names.js | 2 +- ...elds-multiple-definitions-literal-names.js | 2 +- ...elds-multiple-definitions-private-names.js | 14 +-- ...tiple-definitions-static-private-fields.js | 102 +++++++++++++++++ ...efinitions-static-private-methods-proxy.js | 40 +++++++ ...iple-definitions-static-private-methods.js | 108 ++++++++++++++++++ ...ltiple-definitions-string-literal-names.js | 2 +- ...iple-stacked-definitions-computed-names.js | 2 +- ...acked-definitions-computed-symbol-names.js | 2 +- ...tiple-stacked-definitions-literal-names.js | 2 +- ...tiple-stacked-definitions-private-names.js | 14 +-- ...acked-definitions-static-private-fields.js | 80 +++++++++++++ ...cked-definitions-static-private-methods.js | 86 ++++++++++++++ ...tacked-definitions-string-literal-names.js | 2 +- ...ds-new-no-sc-line-method-computed-names.js | 2 +- ...no-sc-line-method-computed-symbol-names.js | 2 +- ...lds-new-no-sc-line-method-literal-names.js | 2 +- ...lds-new-no-sc-line-method-private-names.js | 14 +-- ...no-sc-line-method-static-private-fields.js | 67 +++++++++++ ...o-sc-line-method-static-private-methods.js | 73 ++++++++++++ ...-no-sc-line-method-string-literal-names.js | 2 +- .../fields-new-sc-line-gen-computed-names.js | 2 +- ...s-new-sc-line-gen-computed-symbol-names.js | 2 +- .../fields-new-sc-line-gen-literal-names.js | 2 +- .../fields-new-sc-line-gen-private-names.js | 14 +-- ...s-new-sc-line-gen-static-private-fields.js | 67 +++++++++++ ...-new-sc-line-gen-static-private-methods.js | 73 ++++++++++++ ...ds-new-sc-line-gen-string-literal-names.js | 2 +- ...ields-new-sc-line-method-computed-names.js | 2 +- ...ew-sc-line-method-computed-symbol-names.js | 2 +- ...fields-new-sc-line-method-literal-names.js | 2 +- ...fields-new-sc-line-method-private-names.js | 14 +-- ...ew-sc-line-method-static-private-fields.js | 67 +++++++++++ ...w-sc-line-method-static-private-methods.js | 73 ++++++++++++ ...new-sc-line-method-string-literal-names.js | 2 +- ...vate-direct-eval-err-contains-arguments.js | 36 ++++++ ...vate-direct-eval-err-contains-newtarget.js | 34 ++++++ ...te-indirect-eval-err-contains-arguments.js | 36 ++++++ ...te-indirect-eval-err-contains-newtarget.js | 35 ++++++ .../class/fields-redeclaration-symbol.js | 2 +- .../expressions/class/fields-redeclaration.js | 2 +- ...elds-regular-definitions-computed-names.js | 2 +- ...gular-definitions-computed-symbol-names.js | 2 +- ...ields-regular-definitions-literal-names.js | 2 +- ...ields-regular-definitions-private-names.js | 14 +-- ...ular-definitions-static-private-fields.js} | 28 +++-- ...ular-definitions-static-private-methods.js | 61 ++++++++++ ...egular-definitions-string-literal-names.js | 2 +- ...elds-same-line-async-gen-computed-names.js | 2 +- ...me-line-async-gen-computed-symbol-names.js | 2 +- ...ields-same-line-async-gen-literal-names.js | 2 +- ...ields-same-line-async-gen-private-names.js | 14 +-- ...me-line-async-gen-static-private-fields.js | 70 ++++++++++++ ...e-line-async-gen-static-private-methods.js | 76 ++++++++++++ ...ame-line-async-gen-string-literal-names.js | 2 +- ...s-same-line-async-method-computed-names.js | 2 +- ...line-async-method-computed-symbol-names.js | 2 +- ...ds-same-line-async-method-literal-names.js | 2 +- ...ds-same-line-async-method-private-names.js | 14 +-- ...line-async-method-static-private-fields.js | 69 +++++++++++ ...ine-async-method-static-private-methods.js | 75 ++++++++++++ ...-line-async-method-string-literal-names.js | 2 +- .../fields-same-line-gen-computed-names.js | 2 +- ...lds-same-line-gen-computed-symbol-names.js | 2 +- .../fields-same-line-gen-literal-names.js | 2 +- .../fields-same-line-gen-private-names.js | 14 +-- ...lds-same-line-gen-static-private-fields.js | 66 +++++++++++ ...ds-same-line-gen-static-private-methods.js | 72 ++++++++++++ ...elds-same-line-gen-string-literal-names.js | 2 +- .../fields-same-line-method-computed-names.js | 2 +- ...-same-line-method-computed-symbol-names.js | 2 +- .../fields-same-line-method-literal-names.js | 2 +- .../fields-same-line-method-private-names.js | 14 +-- ...-same-line-method-static-private-fields.js | 66 +++++++++++ ...same-line-method-static-private-methods.js | 72 ++++++++++++ ...s-same-line-method-string-literal-names.js | 2 +- ...c-comp-name-init-err-contains-arguments.js | 35 ++++++ ...tatic-comp-name-init-err-contains-super.js | 28 +++++ ...tic-literal-init-err-contains-arguments.js | 34 ++++++ ...-static-literal-init-err-contains-super.js | 27 +++++ ...tic-private-init-err-contains-arguments.js | 34 ++++++ ...-static-private-init-err-contains-super.js | 27 +++++ ...iteral-name-init-err-contains-arguments.js | 34 ++++++ ...ng-literal-name-init-err-contains-super.js | 27 +++++ .../fields-wrapped-in-sc-computed-names.js | 2 +- ...lds-wrapped-in-sc-computed-symbol-names.js | 2 +- .../fields-wrapped-in-sc-literal-names.js | 2 +- .../fields-wrapped-in-sc-private-names.js | 14 +-- ...lds-wrapped-in-sc-static-private-fields.js | 57 +++++++++ ...ds-wrapped-in-sc-static-private-methods.js | 63 ++++++++++ ...elds-wrapped-in-sc-string-literal-names.js | 2 +- ...ate-fields-proxy-default-handler-throws.js | 30 +++++ ...ate-fields-proxy-default-handler-throws.js | 28 +++++ ...te-methods-proxy-default-handler-throws.js | 31 +++++ ...elds-after-same-line-gen-computed-names.js | 2 +- ...ter-same-line-gen-computed-symbol-names.js | 2 +- ...ields-after-same-line-gen-literal-names.js | 2 +- ...ields-after-same-line-gen-private-names.js | 14 +-- ...ter-same-line-gen-static-private-fields.js | 66 +++++++++++ ...er-same-line-gen-static-private-methods.js | 72 ++++++++++++ ...fter-same-line-gen-string-literal-names.js | 2 +- ...s-after-same-line-method-computed-names.js | 2 +- ...-same-line-method-computed-symbol-names.js | 2 +- ...ds-after-same-line-method-literal-names.js | 2 +- ...ds-after-same-line-method-private-names.js | 14 +-- ...-same-line-method-static-private-fields.js | 66 +++++++++++ ...same-line-method-static-private-methods.js | 72 ++++++++++++ ...r-same-line-method-string-literal-names.js | 2 +- ...me-line-static-async-gen-computed-names.js | 2 +- ...-static-async-gen-computed-symbol-names.js | 2 +- ...ame-line-static-async-gen-literal-names.js | 2 +- ...ame-line-static-async-gen-private-names.js | 14 +-- ...-static-async-gen-static-private-fields.js | 70 ++++++++++++ ...static-async-gen-static-private-methods.js | 76 ++++++++++++ ...e-static-async-gen-string-literal-names.js | 2 +- ...line-static-async-method-computed-names.js | 2 +- ...atic-async-method-computed-symbol-names.js | 2 +- ...-line-static-async-method-literal-names.js | 2 +- ...-line-static-async-method-private-names.js | 14 +-- ...atic-async-method-static-private-fields.js | 69 +++++++++++ ...tic-async-method-static-private-methods.js | 75 ++++++++++++ ...tatic-async-method-string-literal-names.js | 2 +- ...ter-same-line-static-gen-computed-names.js | 2 +- ...e-line-static-gen-computed-symbol-names.js | 2 +- ...fter-same-line-static-gen-literal-names.js | 2 +- ...fter-same-line-static-gen-private-names.js | 14 +-- ...e-line-static-gen-static-private-fields.js | 66 +++++++++++ ...-line-static-gen-static-private-methods.js | 72 ++++++++++++ ...me-line-static-gen-string-literal-names.js | 2 +- ...-same-line-static-method-computed-names.js | 2 +- ...ine-static-method-computed-symbol-names.js | 2 +- ...r-same-line-static-method-literal-names.js | 2 +- ...r-same-line-static-method-private-names.js | 14 +-- ...ine-static-method-static-private-fields.js | 66 +++++++++++ ...ne-static-method-static-private-methods.js | 72 ++++++++++++ ...line-static-method-string-literal-names.js | 2 +- ...s-comp-name-init-err-contains-arguments.js | 35 ++++++ ...ields-comp-name-init-err-contains-super.js | 28 +++++ ...fields-computed-name-toprimitive-symbol.js | 2 +- .../class/fields-computed-name-toprimitive.js | 2 +- ...uted-variable-name-propname-constructor.js | 33 ------ .../fields-ctor-called-after-fields-init.js | 2 +- ...ls-direct-eval-err-contains-supercall-1.js | 3 +- ...ls-direct-eval-err-contains-supercall-2.js | 10 +- ...-cls-direct-eval-err-contains-supercall.js | 3 +- ...irect-eval-err-contains-superproperty-1.js | 3 +- ...irect-eval-err-contains-superproperty-2.js | 18 ++- ...-indirect-eval-err-contains-supercall-1.js | 7 +- ...-indirect-eval-err-contains-supercall-2.js | 14 +-- ...ls-indirect-eval-err-contains-supercall.js | 7 +- ...irect-eval-err-contains-superproperty-1.js | 7 +- ...irect-eval-err-contains-superproperty-2.js | 22 ++-- ...elds-direct-eval-err-contains-newtarget.js | 2 +- ...tion-error-computed-name-referenceerror.js | 2 +- ...ion-error-computed-name-toprimitive-err.js | 2 +- ...ed-name-toprimitive-returns-noncallable.js | 57 +++++++++ ...uted-name-toprimitive-returns-nonobject.js | 56 +++++++++ ...uation-error-computed-name-tostring-err.js | 2 +- ...luation-error-computed-name-valueof-err.js | 2 +- ...ds-indirect-eval-err-contains-newtarget.js | 2 +- .../class/fields-init-err-evaluation.js | 2 +- .../fields-init-value-defined-after-class.js | 2 +- .../class/fields-init-value-incremental.js | 2 +- ...lds-multiple-definitions-computed-names.js | 2 +- ...tiple-definitions-computed-symbol-names.js | 2 +- ...elds-multiple-definitions-literal-names.js | 2 +- ...elds-multiple-definitions-private-names.js | 14 +-- ...tiple-definitions-static-private-fields.js | 102 +++++++++++++++++ ...iple-definitions-static-private-methods.js | 108 ++++++++++++++++++ ...ltiple-definitions-string-literal-names.js | 2 +- ...iple-stacked-definitions-computed-names.js | 2 +- ...acked-definitions-computed-symbol-names.js | 2 +- ...tiple-stacked-definitions-literal-names.js | 2 +- ...tiple-stacked-definitions-private-names.js | 14 +-- ...acked-definitions-static-private-fields.js | 80 +++++++++++++ ...cked-definitions-static-private-methods.js | 86 ++++++++++++++ ...tacked-definitions-string-literal-names.js | 2 +- ...ds-new-no-sc-line-method-computed-names.js | 2 +- ...no-sc-line-method-computed-symbol-names.js | 2 +- ...lds-new-no-sc-line-method-literal-names.js | 2 +- ...lds-new-no-sc-line-method-private-names.js | 14 +-- ...no-sc-line-method-static-private-fields.js | 67 +++++++++++ ...o-sc-line-method-static-private-methods.js | 73 ++++++++++++ ...-no-sc-line-method-string-literal-names.js | 2 +- .../fields-new-sc-line-gen-computed-names.js | 2 +- ...s-new-sc-line-gen-computed-symbol-names.js | 2 +- .../fields-new-sc-line-gen-literal-names.js | 2 +- .../fields-new-sc-line-gen-private-names.js | 14 +-- ...s-new-sc-line-gen-static-private-fields.js | 67 +++++++++++ ...-new-sc-line-gen-static-private-methods.js | 73 ++++++++++++ ...ds-new-sc-line-gen-string-literal-names.js | 2 +- ...ields-new-sc-line-method-computed-names.js | 2 +- ...ew-sc-line-method-computed-symbol-names.js | 2 +- ...fields-new-sc-line-method-literal-names.js | 2 +- ...fields-new-sc-line-method-private-names.js | 14 +-- ...ew-sc-line-method-static-private-fields.js | 67 +++++++++++ ...w-sc-line-method-static-private-methods.js | 73 ++++++++++++ ...new-sc-line-method-string-literal-names.js | 2 +- ...vate-direct-eval-err-contains-arguments.js | 36 ++++++ ...vate-direct-eval-err-contains-newtarget.js | 34 ++++++ ...te-indirect-eval-err-contains-arguments.js | 36 ++++++ ...te-indirect-eval-err-contains-newtarget.js | 35 ++++++ .../class/fields-redeclaration-symbol.js | 2 +- .../statements/class/fields-redeclaration.js | 2 +- ...elds-regular-definitions-computed-names.js | 2 +- ...gular-definitions-computed-symbol-names.js | 2 +- ...ields-regular-definitions-literal-names.js | 2 +- ...ields-regular-definitions-private-names.js | 14 +-- ...ular-definitions-static-private-fields.js} | 24 ++-- ...ular-definitions-static-private-methods.js | 61 ++++++++++ ...egular-definitions-string-literal-names.js | 2 +- ...elds-same-line-async-gen-computed-names.js | 2 +- ...me-line-async-gen-computed-symbol-names.js | 2 +- ...ields-same-line-async-gen-literal-names.js | 2 +- ...ields-same-line-async-gen-private-names.js | 14 +-- ...me-line-async-gen-static-private-fields.js | 70 ++++++++++++ ...e-line-async-gen-static-private-methods.js | 76 ++++++++++++ ...ame-line-async-gen-string-literal-names.js | 2 +- ...s-same-line-async-method-computed-names.js | 2 +- ...line-async-method-computed-symbol-names.js | 2 +- ...ds-same-line-async-method-literal-names.js | 2 +- ...ds-same-line-async-method-private-names.js | 14 +-- ...line-async-method-static-private-fields.js | 69 +++++++++++ ...ine-async-method-static-private-methods.js | 75 ++++++++++++ ...-line-async-method-string-literal-names.js | 2 +- .../fields-same-line-gen-computed-names.js | 2 +- ...lds-same-line-gen-computed-symbol-names.js | 2 +- .../fields-same-line-gen-literal-names.js | 2 +- .../fields-same-line-gen-private-names.js | 14 +-- ...lds-same-line-gen-static-private-fields.js | 66 +++++++++++ ...ds-same-line-gen-static-private-methods.js | 72 ++++++++++++ ...elds-same-line-gen-string-literal-names.js | 2 +- .../fields-same-line-method-computed-names.js | 2 +- ...-same-line-method-computed-symbol-names.js | 2 +- .../fields-same-line-method-literal-names.js | 2 +- .../fields-same-line-method-private-names.js | 14 +-- ...-same-line-method-static-private-fields.js | 66 +++++++++++ ...same-line-method-static-private-methods.js | 72 ++++++++++++ ...s-same-line-method-string-literal-names.js | 2 +- ...c-comp-name-init-err-contains-arguments.js | 2 +- ...tatic-comp-name-init-err-contains-super.js | 2 +- ...tic-literal-init-err-contains-arguments.js | 2 +- ...-static-literal-init-err-contains-super.js | 2 +- ...tic-private-init-err-contains-arguments.js | 2 +- ...-static-private-init-err-contains-super.js | 2 +- ...iteral-name-init-err-contains-arguments.js | 2 +- ...ng-literal-name-init-err-contains-super.js | 2 +- .../fields-wrapped-in-sc-computed-names.js | 2 +- ...lds-wrapped-in-sc-computed-symbol-names.js | 2 +- .../fields-wrapped-in-sc-literal-names.js | 2 +- .../fields-wrapped-in-sc-private-names.js | 14 +-- ...ds-wrapped-in-sc-static-private-fields.js} | 30 +++-- ...ds-wrapped-in-sc-static-private-methods.js | 63 ++++++++++ ...elds-wrapped-in-sc-string-literal-names.js | 2 +- ...privatename-not-valid-earlyerr-script-7.js | 2 +- ...privatename-not-valid-earlyerr-script-8.js | 2 +- 325 files changed, 6187 insertions(+), 622 deletions(-) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js delete mode 100644 test/language/expressions/class/fields-computed-variable-name-propname-constructor.js create mode 100644 test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js create mode 100644 test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-private-fields.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-private-methods-proxy.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-private-methods.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-private-fields.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-private-direct-eval-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js create mode 100644 test/language/expressions/class/fields-private-indirect-eval-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js rename test/language/{statements/class/fields-static-private-names.js => expressions/class/fields-regular-definitions-static-private-fields.js} (71%) create mode 100644 test/language/expressions/class/fields-regular-definitions-static-private-methods.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-private-fields.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-private-methods.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-private-fields.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-private-methods.js create mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-static-literal-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-private-init-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-static-private-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js create mode 100644 test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-private-fields.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js create mode 100644 test/language/expressions/class/private-fields-proxy-default-handler-throws.js create mode 100644 test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js create mode 100644 test/language/expressions/class/static-private-methods-proxy-default-handler-throws.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-comp-name-init-err-contains-super.js delete mode 100644 test/language/statements/class/fields-computed-variable-name-propname-constructor.js create mode 100644 test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js create mode 100644 test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-private-fields.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-private-methods.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-private-fields.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-private-direct-eval-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js create mode 100644 test/language/statements/class/fields-private-indirect-eval-err-contains-arguments.js create mode 100644 test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js rename test/language/statements/class/{fields-static-private-fields.js => fields-regular-definitions-static-private-fields.js} (75%) create mode 100644 test/language/statements/class/fields-regular-definitions-static-private-methods.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-private-methods.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-private-fields.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-private-methods.js create mode 100644 test/language/statements/class/fields-same-line-method-static-private-fields.js create mode 100644 test/language/statements/class/fields-same-line-method-static-private-methods.js rename test/language/statements/class/{fields-static-private-methods.js => fields-wrapped-in-sc-static-private-fields.js} (69%) create mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js diff --git a/test/language/expressions/class/err-field-delete-covered-member-expression-privatename.js b/test/language/expressions/class/err-field-delete-covered-member-expression-privatename.js index d77e55b4e1..4903bbe3bc 100644 --- a/test/language/expressions/class/err-field-delete-covered-member-expression-privatename.js +++ b/test/language/expressions/class/err-field-delete-covered-member-expression-privatename.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if you call delete on member expressions . privatename (in field, covered) esid: sec-class-definitions-static-semantics-early-errors -features: [class-fields-private, class] +features: [class-fields-private, class, class-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/expressions/class/fields-after-same-line-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-gen-computed-names.js index 874f2cdfcb..81276cc9a9 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js index ca449cf303..5b1638c4ab 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-gen-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-literal-names.js index cf16227496..a895a065c7 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-gen-private-names.js b/test/language/expressions/class/fields-after-same-line-gen-private-names.js index e730657f11..456c88bca9 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- -description: static literal private names (field definitions after a generator in the same line) +description: private names (field definitions after a generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-fields.js new file mode 100644 index 0000000000..2812237a8e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: static private fields (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js new file mode 100644 index 0000000000..a7b69d61cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: static private methods (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js index fbec943402..2b1e596888 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-method-computed-names.js index 21da891022..5a5da9ea56 100644 --- a/test/language/expressions/class/fields-after-same-line-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js index 81e5ca2a23..e21e2a8a7d 100644 --- a/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-method-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-literal-names.js index 542488ff92..fb0a1cb92c 100644 --- a/test/language/expressions/class/fields-after-same-line-method-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-method-private-names.js b/test/language/expressions/class/fields-after-same-line-method-private-names.js index 145f1398d3..7c65b26ac2 100644 --- a/test/language/expressions/class/fields-after-same-line-method-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- -description: static literal private names (field definitions after a method in the same line) +description: private names (field definitions after a method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-method-static-private-fields.js new file mode 100644 index 0000000000..5f8209be7d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: static private fields (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js new file mode 100644 index 0000000000..a45087347c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: static private methods (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js index bc534cb4b9..a1d0ef3ad2 100644 --- a/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js index 2a66b8ee76..4f92e5bc9f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js index 2ea39e9b6b..80d36a6128 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { static async *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js index e4ebb76d4b..b298c5f633 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { static async *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js index 167504e93f..8a73040702 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- -description: static literal private names (field definitions after a static async generator in the same line) +description: private names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { static async *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js new file mode 100644 index 0000000000..8f27dd8736 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: static private fields (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js new file mode 100644 index 0000000000..d8e030b0d5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: static private methods (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js index 464838a511..95e1a46432 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { static async *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js index e39f9c059d..b32ed9b83f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js index dd0650e0e8..392fb7b0a6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { static async m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js index 1e1af3d4dc..14f723d1dd 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { static async m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js index df6dd1aeb7..2dfe19655f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- -description: static literal private names (field definitions after a static async method in the same line) +description: private names (field definitions after a static async method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { static async m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js new file mode 100644 index 0000000000..21a43260e1 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: static private fields (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js new file mode 100644 index 0000000000..3a61adf3ff --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: static private methods (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js index 25ce5be1f2..9d0422cbdc 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { static async m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js index 4f3cf3e534..6012cc4503 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js index 6aec78a03d..2ebffeedb6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { static *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js index 2ba95a6f14..a89c5d2db9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { static *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-private-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-private-names.js index 5883a5abc0..c1a73d77f4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- -description: static literal private names (field definitions after a static generator in the same line) +description: private names (field definitions after a static generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { static *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-fields.js new file mode 100644 index 0000000000..4e8ea78049 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: static private fields (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js new file mode 100644 index 0000000000..b7e9ca1ae2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: static private methods (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js index 1b83642272..caa4ce8271 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { static *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js index 66eb3d0989..7b67ffd5a6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js index 82f3a4eaed..3d1d410d26 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { static m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js index 59a4c9c354..0e79cf5cd4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { static m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-private-names.js b/test/language/expressions/class/fields-after-same-line-static-method-private-names.js index 48fe0208dd..3ab534569e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- -description: static literal private names (field definitions after a static method in the same line) +description: private names (field definitions after a static method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { static m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-fields.js new file mode 100644 index 0000000000..852fa7ce83 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: static private fields (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js new file mode 100644 index 0000000000..8cb2832729 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: static private methods (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js index d4d1e093b1..d8d96aa6fa 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { static m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js index c9437b784d..5177e0ca3f 100644 --- a/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js @@ -4,7 +4,7 @@ /*--- description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, Symbol, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, Symbol, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/expressions/class/fields-computed-name-toprimitive.js b/test/language/expressions/class/fields-computed-name-toprimitive.js index 7329aa9b8f..cf1349be07 100644 --- a/test/language/expressions/class/fields-computed-name-toprimitive.js +++ b/test/language/expressions/class/fields-computed-name-toprimitive.js @@ -4,7 +4,7 @@ /*--- description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js deleted file mode 100644 index bceceabf9e..0000000000 --- a/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-expr-variable-name.template -/*--- -description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "constructor". - ----*/ - - -var constructor = 'foo'; -var C = class { - [constructor]; -}; - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), true); - -assert.sameValue(C.hasOwnProperty("foo"), false); diff --git a/test/language/expressions/class/fields-ctor-called-after-fields-init.js b/test/language/expressions/class/fields-ctor-called-after-fields-init.js index 1ea88de76c..86745235bc 100644 --- a/test/language/expressions/class/fields-ctor-called-after-fields-init.js +++ b/test/language/expressions/class/fields-ctor-called-after-fields-init.js @@ -4,7 +4,7 @@ /*--- description: The constructor method is called after the fields are initalized (field definitions in a class expression) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] info: | [[Construct]] ( argumentsList, newTarget) diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js index b80496c694..dd380aacfe 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js @@ -23,9 +23,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; super()["x"];'); } diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js index e09d0a2b17..e7a2fde569 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js @@ -7,13 +7,6 @@ esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. ScriptBody:StatementList @@ -23,9 +16,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; super().x;'); } diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js index 4b4a50c00f..e518d46538 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js @@ -23,9 +23,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; super();'); } diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js index 72049e20d9..c7954bc69c 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -23,12 +23,11 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; super.x;'); -} +}; new C(); diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js index 2c0c1c52a5..01a9d1f632 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -2,33 +2,29 @@ // - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/initializer-eval-super-property/cls-expr-fields-eval.template /*--- -description: error if `super['x']` in StatementList of eval (direct eval) +description: error if super['x'] in StatementList of eval (direct eval) esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods - These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = eval('executed = true; super["x"];'); -} +}; new C(); diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index 325a0d040c..a9c97fe8cd 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -23,9 +23,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; super()["x"];'); } diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index ea36cd9ed1..c983e887ce 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -7,13 +7,6 @@ esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. ScriptBody:StatementList @@ -23,9 +16,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; super().x;'); } diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index 2bb1d7f2ab..44bb95f62f 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -23,9 +23,8 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; super();'); } diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index 36bf98e3e9..9878a14a92 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -23,12 +23,11 @@ info: | ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; super.x;'); -} +}; assert.throws(SyntaxError, function() { new C(); diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js index e636dc056b..9ea13833b2 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -2,33 +2,29 @@ // - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/initializer-eval-super-property/cls-expr-fields-indirect-eval.template /*--- -description: error if `super['x']` in StatementList of eval (indirect eval) +description: error if super['x'] in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods - These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. ---*/ -var A = class {} - var executed = false; +var A = class {} var C = class extends A { x = (0, eval)('executed = true; super["x"];'); -} +}; assert.throws(SyntaxError, function() { new C(); diff --git a/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js index 94cb63a9ea..9422ebd006 100644 --- a/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js @@ -4,7 +4,7 @@ /*--- description: error if `new.target` in StatementList of eval (direct eval) esid: sec-performeval-rules-in-initializer -features: [class, class-fields-public, new.target] +features: [class, new.target, class-fields-public] flags: [generated] info: | Additional Early Error Rules for Eval Inside Initializer diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js b/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js index 66a6c14326..ead74882c3 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js @@ -4,7 +4,7 @@ /*--- description: ReferenceError evaluating a computed property name (field definitions in a class expression) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js index 0522c25592..79dbe2d852 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class expression) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js new file mode 100644 index 0000000000..ccd69779f0 --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-returns-noncallable.case +// - src/class-fields/class-evaluation-error/cls-expr.template +/*--- +description: Custom error evaluating a computed property name (field definitions in a class expression) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, Symbol.toPrimitive, class] +flags: [generated] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ... + 27. For each ClassElement e in order from elements + a. If IsStatic of me is false, then + i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). + ... + + Runtime Semantics: ClassElementEvaluation + + ClassElement: FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. + + Runtime Semantics: ClassFieldDefinitionEvaluation + With parameters isStatic and homeObject. + + 1. Let fieldName be the result of evaluating ClassElementName. + 2. ReturnIfAbrupt(fieldName). + ... + + Runtime Semantics: Evaluation + ComputedPropertyName: [ AssignmentExpression ] + + 1. Let exprValue be the result of evaluating AssignmentExpression. + 2. Let propName be ? GetValue(exprValue). + 3. Return ? ToPropertyKey(propName). + +---*/ +var obj = { + [Symbol.toPrimitive]: {} +}; + + + +function evaluate() { + var C = class { + [obj] = refErrorIfEvaluated; + }; +} + +assert.throws(TypeError +, evaluate); diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js new file mode 100644 index 0000000000..3c56ba8a5e --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-returns-nonobject.case +// - src/class-fields/class-evaluation-error/cls-expr.template +/*--- +description: Custom error evaluating a computed property name (field definitions in a class expression) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, Symbol.toPrimitive, class] +flags: [generated] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ... + 27. For each ClassElement e in order from elements + a. If IsStatic of me is false, then + i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). + ... + + Runtime Semantics: ClassElementEvaluation + + ClassElement: FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. + + Runtime Semantics: ClassFieldDefinitionEvaluation + With parameters isStatic and homeObject. + + 1. Let fieldName be the result of evaluating ClassElementName. + 2. ReturnIfAbrupt(fieldName). + ... + + Runtime Semantics: Evaluation + ComputedPropertyName: [ AssignmentExpression ] + + 1. Let exprValue be the result of evaluating AssignmentExpression. + 2. Let propName be ? GetValue(exprValue). + 3. Return ? ToPropertyKey(propName). + +---*/ +var obj = { + [Symbol.toPrimitive]: 42 +}; + + + +function evaluate() { + var C = class { + [obj] = refErrorIfEvaluated; + }; +} + +assert.throws(TypeError, evaluate); diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js index cecb9de938..7324732650 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class expression) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js b/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js index f709947c11..20f3fe4558 100644 --- a/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class expression) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js index 84a0c29d70..e008008671 100644 --- a/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js @@ -4,7 +4,7 @@ /*--- description: error if `new.target` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer -features: [class, class-fields-public, new.target] +features: [class, new.target, class-fields-public] flags: [generated] info: | Additional Early Error Rules for Eval Inside Initializer diff --git a/test/language/expressions/class/fields-init-err-evaluation.js b/test/language/expressions/class/fields-init-err-evaluation.js index dd81e90753..baf937e731 100644 --- a/test/language/expressions/class/fields-init-err-evaluation.js +++ b/test/language/expressions/class/fields-init-err-evaluation.js @@ -4,7 +4,7 @@ /*--- description: Return abrupt completion evaluating the field initializer (field definitions in a class expression) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] info: | [[Construct]] ( argumentsList, newTarget) diff --git a/test/language/expressions/class/fields-init-value-defined-after-class.js b/test/language/expressions/class/fields-init-value-defined-after-class.js index 0a2f10d1eb..52e4047a62 100644 --- a/test/language/expressions/class/fields-init-value-defined-after-class.js +++ b/test/language/expressions/class/fields-init-value-defined-after-class.js @@ -4,7 +4,7 @@ /*--- description: The initializer value is defined after the class evaluation (field definitions in a class expression) esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/expressions/class/fields-init-value-incremental.js b/test/language/expressions/class/fields-init-value-incremental.js index b2b87b9924..b8b62d937b 100644 --- a/test/language/expressions/class/fields-init-value-incremental.js +++ b/test/language/expressions/class/fields-init-value-incremental.js @@ -4,7 +4,7 @@ /*--- description: The initializer value is defined during the class instatiation (field definitions in a class expression) esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/expressions/class/fields-multiple-definitions-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-computed-names.js index a2ee0a53a3..3017265522 100644 --- a/test/language/expressions/class/fields-multiple-definitions-computed-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-computed-names.js @@ -29,7 +29,7 @@ var C = class { [x] = 42; [10] = "meep"; ["not initialized"] m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js index 4de6b2039a..f95fd4a73b 100644 --- a/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-computed-symbol-names.js @@ -30,7 +30,7 @@ var C = class { [x]; [y] = 42 m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-definitions-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-literal-names.js index c6036f8514..66de23bea5 100644 --- a/test/language/expressions/class/fields-multiple-definitions-literal-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-literal-names.js @@ -30,7 +30,7 @@ var C = class { c = fn m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-definitions-private-names.js b/test/language/expressions/class/fields-multiple-definitions-private-names.js index 716b43beaf..ceef5621fb 100644 --- a/test/language/expressions/class/fields-multiple-definitions-private-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- -description: static literal private names (multiple fields definitions) +description: private names (multiple fields definitions) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -30,7 +30,7 @@ var C = class { #x; #y m2() { return 39 } bar = "barbaz"; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-fields.js b/test/language/expressions/class/fields-multiple-definitions-static-private-fields.js new file mode 100644 index 0000000000..8898f73090 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-fields.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: static private fields (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #x; static #y + m2() { return 39 } + bar = "barbaz"; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-methods-proxy.js b/test/language/expressions/class/fields-multiple-definitions-static-private-methods-proxy.js new file mode 100644 index 0000000000..5a46f0832c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-methods-proxy.js @@ -0,0 +1,40 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Static private methods not accessible via default Proxy handler +esid: prod-FieldDefinition +features: [class, class-static-methods-private] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x(value) { + return 1; + } + static x() { + return this.#x(); + } +} + +var P = new Proxy(C, {}); + +assert.sameValue(C.x(), 1); +assert.throws(TypeError, function() { + P.x(); +}); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js b/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js new file mode 100644 index 0000000000..dec012b261 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: static private methods (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #xVal; static #yVal + m2() { return 39 } + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js index e2957ad149..a2815cd54f 100644 --- a/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-string-literal-names.js @@ -28,7 +28,7 @@ var C = class { "d" = 42 m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js index fb384b1376..0174e24669 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-names.js @@ -27,7 +27,7 @@ var C = class { [x] = 42; [10] = "meep"; ["not initialized"] foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js index d92d329622..97ac2d4f73 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js @@ -28,7 +28,7 @@ var C = class { [x]; [y] = 42 foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js index f0a676b327..2ca220c61c 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names.js @@ -28,7 +28,7 @@ var C = class { c = fn foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-private-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-private-names.js index 6dc6095542..3bf30d3655 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-private-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- -description: static literal private names (multiple stacked fields definitions through ASI) +description: private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -28,7 +28,7 @@ var C = class { #x; #y foo = "foobar" bar = "barbaz"; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-fields.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-fields.js new file mode 100644 index 0000000000..b92b29eb46 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-fields.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: static private fields (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y + foo = "foobar" + bar = "barbaz"; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js new file mode 100644 index 0000000000..85791c2060 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: static private methods (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + foo = "foobar" + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js index 90c6b7cd1b..1de4a11c09 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js @@ -26,7 +26,7 @@ var C = class { "d" = 42 foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js index 50538a5dea..0c10e823dc 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"] m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js index 3139836e1c..5ec1f72a6e 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42 m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js index 477b4b21fd..20aaeeac10 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names.js @@ -27,7 +27,7 @@ var C = class { a; b = 42; c = fn m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-private-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-private-names.js index 76048e7e03..32828b7303 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-private-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- -description: static literal private names (field definitions followed by a method in a new line without a semicolon) +description: private names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | var C = class { #x; #y m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-fields.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-fields.js new file mode 100644 index 0000000000..be9b34dd24 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: static private fields (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y + m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js new file mode 100644 index 0000000000..5c41cadc9a --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: static private methods (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js index 3183a04453..5466a60bca 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js @@ -25,7 +25,7 @@ var C = class { 'a'; "b"; 'c' = 39; "d" = 42 m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js b/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js index 5d1e910a38..ecea272f92 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js index 2e3e813a50..fdfbb093dd 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js index 2551403195..102b482453 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-literal-names.js @@ -27,7 +27,7 @@ var C = class { a; b = 42; c = fn; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-private-names.js b/test/language/expressions/class/fields-new-sc-line-gen-private-names.js index e72c8e6748..399bf822c9 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-private-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- -description: static literal private names (field definitions followed by a method in a new line with a semicolon) +description: private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | var C = class { #x; #y; *m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-fields.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-fields.js new file mode 100644 index 0000000000..1595aca16c --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: static private fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y; + *m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js new file mode 100644 index 0000000000..525cb72141 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: static private methods (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; + *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js index 751a5016a5..ecc41b6ee3 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-string-literal-names.js @@ -25,7 +25,7 @@ var C = class { 'a'; "b"; 'c' = 39; "d" = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-method-computed-names.js b/test/language/expressions/class/fields-new-sc-line-method-computed-names.js index 37a17dee8f..feee67ec7e 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js index fdf9cf0f75..93bbdd4a1c 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-method-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-literal-names.js index 0f771745d3..239c4b5aa2 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-literal-names.js @@ -27,7 +27,7 @@ var C = class { a; b = 42; c = fn; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-new-sc-line-method-private-names.js b/test/language/expressions/class/fields-new-sc-line-method-private-names.js index 959a5874e4..79bc6a00f4 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-private-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- -description: static literal private names (field definitions followed by a method in a new line with a semicolon) +description: private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | var C = class { #x; #y; m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-fields.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-fields.js new file mode 100644 index 0000000000..babe419336 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: static private fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y; + m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js new file mode 100644 index 0000000000..4074913bf3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: static private methods (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js index da01227204..5a8c955e35 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-string-literal-names.js @@ -25,7 +25,7 @@ var C = class { 'a'; "b"; 'c' = 39; "d" = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-private-direct-eval-err-contains-arguments.js b/test/language/expressions/class/fields-private-direct-eval-err-contains-arguments.js new file mode 100644 index 0000000000..1c0c822c55 --- /dev/null +++ b/test/language/expressions/class/fields-private-direct-eval-err-contains-arguments.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-arguments.case +// - src/class-fields/initializer-eval-arguments/cls-expr-private-fields-eval.template +/*--- +description: error if `arguments` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + It is a Syntax Error if ContainsArguments of StatementList is true. + ... + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +var executed = false; +var C = class { + #x = eval('executed = true; arguments;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js new file mode 100644 index 0000000000..2273bc4dfd --- /dev/null +++ b/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-newtarget.case +// - src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-eval.template +/*--- +description: error if `new.target` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, new.target, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Functions + These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. + ScriptBody:StatementList + + It is a Syntax Error if StatementList Contains NewTarget. + +---*/ + + +var executed = false; +var C = class { + #x = eval('executed = true; new.target;'); +} + +var c = new C(); + +assert.sameValue(executed, true); +assert.sameValue(c.x, undefined); diff --git a/test/language/expressions/class/fields-private-indirect-eval-err-contains-arguments.js b/test/language/expressions/class/fields-private-indirect-eval-err-contains-arguments.js new file mode 100644 index 0000000000..15fc715f65 --- /dev/null +++ b/test/language/expressions/class/fields-private-indirect-eval-err-contains-arguments.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-arguments.case +// - src/class-fields/initializer-eval-arguments/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `arguments` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + It is a Syntax Error if ContainsArguments of StatementList is true. + ... + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +var executed = false; +var C = class { + #x = (0, eval)('executed = true; arguments;'); +} + +assert.throws(ReferenceError, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js new file mode 100644 index 0000000000..42e0f30ecf --- /dev/null +++ b/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-newtarget.case +// - src/class-fields/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `new.target` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, new.target, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Functions + These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. + ScriptBody:StatementList + + It is a Syntax Error if StatementList Contains NewTarget. + +---*/ + + +var executed = false; +var C = class { + #x = (0, eval)('executed = true; new.target;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-redeclaration-symbol.js b/test/language/expressions/class/fields-redeclaration-symbol.js index 4e42bf38d6..f1c1a4dec7 100644 --- a/test/language/expressions/class/fields-redeclaration-symbol.js +++ b/test/language/expressions/class/fields-redeclaration-symbol.js @@ -4,7 +4,7 @@ /*--- description: Redeclaration of public fields with the same name (field definitions in a class expression) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] includes: [propertyHelper.js, compareArray.js] info: | diff --git a/test/language/expressions/class/fields-redeclaration.js b/test/language/expressions/class/fields-redeclaration.js index 24234ce21b..d8762afee1 100644 --- a/test/language/expressions/class/fields-redeclaration.js +++ b/test/language/expressions/class/fields-redeclaration.js @@ -4,7 +4,7 @@ /*--- description: Redeclaration of public fields with the same name (field definitions in a class expression) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] includes: [propertyHelper.js, compareArray.js] info: | diff --git a/test/language/expressions/class/fields-regular-definitions-computed-names.js b/test/language/expressions/class/fields-regular-definitions-computed-names.js index fc724d59d0..fb8da12d2e 100644 --- a/test/language/expressions/class/fields-regular-definitions-computed-names.js +++ b/test/language/expressions/class/fields-regular-definitions-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"] - + } var c = new C(); diff --git a/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js b/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js index 3347897180..87700b4fc9 100644 --- a/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js +++ b/test/language/expressions/class/fields-regular-definitions-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42 - + } var c = new C(); diff --git a/test/language/expressions/class/fields-regular-definitions-literal-names.js b/test/language/expressions/class/fields-regular-definitions-literal-names.js index 6bcbfd9de5..2a7f25dd50 100644 --- a/test/language/expressions/class/fields-regular-definitions-literal-names.js +++ b/test/language/expressions/class/fields-regular-definitions-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { a; b = 42; c = fn - + } var c = new C(); diff --git a/test/language/expressions/class/fields-regular-definitions-private-names.js b/test/language/expressions/class/fields-regular-definitions-private-names.js index 86a26026a4..5e84f59b16 100644 --- a/test/language/expressions/class/fields-regular-definitions-private-names.js +++ b/test/language/expressions/class/fields-regular-definitions-private-names.js @@ -2,30 +2,30 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-regular-definitions.template /*--- -description: static literal private names (regular fields defintion) +description: private names (regular fields defintion) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { #x; #y -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-static-private-names.js b/test/language/expressions/class/fields-regular-definitions-static-private-fields.js similarity index 71% rename from test/language/statements/class/fields-static-private-names.js rename to test/language/expressions/class/fields-regular-definitions-static-private-fields.js index 4192939646..ba9d0f026f 100644 --- a/test/language/statements/class/fields-static-private-names.js +++ b/test/language/expressions/class/fields-regular-definitions-static-private-fields.js @@ -1,32 +1,42 @@ // This file was procedurally generated from the following sources: -// - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl.template +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- -description: literal private names (field definitions in a class declaration) +description: static private fields (regular fields defintion) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class-static-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... static FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName ---*/ -class C { +var C = class { static #x; static #y + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } } +var c = new C(); + // Test the private fields do not appear as properties before set to value assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); diff --git a/test/language/expressions/class/fields-regular-definitions-static-private-methods.js b/test/language/expressions/class/fields-regular-definitions-static-private-methods.js new file mode 100644 index 0000000000..e1ef400f13 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-static-private-methods.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: static private methods (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-regular-definitions-string-literal-names.js b/test/language/expressions/class/fields-regular-definitions-string-literal-names.js index d0afcaa36d..5e316ec03f 100644 --- a/test/language/expressions/class/fields-regular-definitions-string-literal-names.js +++ b/test/language/expressions/class/fields-regular-definitions-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { 'a'; "b"; 'c' = 39; "d" = 42 - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js index d312f9c70d..7f8d920fec 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js index 294259667e..a8d955ec20 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { async *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-gen-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js index 0796a955c9..861efccce1 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { async *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-gen-private-names.js b/test/language/expressions/class/fields-same-line-async-gen-private-names.js index db0ed84992..05ddab3fe4 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- -description: static literal private names (field definitions after an async generator in the same line) +description: private names (field definitions after an async generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { async *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js new file mode 100644 index 0000000000..40d189e4db --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: static private fields (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js new file mode 100644 index 0000000000..2bbac54e1b --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: static private methods (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js index b72f2c2454..108d2cf8f1 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { async *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-method-computed-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-names.js index 82031be527..c358d94b9b 100644 --- a/test/language/expressions/class/fields-same-line-async-method-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js index 1519d8d04f..b211484c3b 100644 --- a/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { async m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-method-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-literal-names.js index 11b3ff42a1..b4dbeb9bc4 100644 --- a/test/language/expressions/class/fields-same-line-async-method-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { async m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-async-method-private-names.js b/test/language/expressions/class/fields-same-line-async-method-private-names.js index c357bc6637..dab4667908 100644 --- a/test/language/expressions/class/fields-same-line-async-method-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- -description: static literal private names (field definitions after an async method in the same line) +description: private names (field definitions after an async method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { async m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js b/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js new file mode 100644 index 0000000000..2370de7b56 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: static private fields (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js b/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js new file mode 100644 index 0000000000..fadd09677c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: static private methods (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js index 9bc2eac679..a311fd7c94 100644 --- a/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { async m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-gen-computed-names.js b/test/language/expressions/class/fields-same-line-gen-computed-names.js index 3f9e73ae98..9beb411697 100644 --- a/test/language/expressions/class/fields-same-line-gen-computed-names.js +++ b/test/language/expressions/class/fields-same-line-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js index 8f038bfb12..77726bee19 100644 --- a/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-gen-literal-names.js b/test/language/expressions/class/fields-same-line-gen-literal-names.js index d59e9e2b89..e3283b6a4b 100644 --- a/test/language/expressions/class/fields-same-line-gen-literal-names.js +++ b/test/language/expressions/class/fields-same-line-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { a; b = 42; c = fn; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-gen-private-names.js b/test/language/expressions/class/fields-same-line-gen-private-names.js index dad18ab09c..91f1b7eefa 100644 --- a/test/language/expressions/class/fields-same-line-gen-private-names.js +++ b/test/language/expressions/class/fields-same-line-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-same-line-generator.template /*--- -description: static literal private names (field definitions followed by a generator method in the same line) +description: private names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { #x; #y; *m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-fields.js b/test/language/expressions/class/fields-same-line-gen-static-private-fields.js new file mode 100644 index 0000000000..5f1fdd0487 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: static private fields (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y; *m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-methods.js b/test/language/expressions/class/fields-same-line-gen-static-private-methods.js new file mode 100644 index 0000000000..d659b01a94 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: static private methods (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-gen-string-literal-names.js b/test/language/expressions/class/fields-same-line-gen-string-literal-names.js index 1765683b65..c566da04d7 100644 --- a/test/language/expressions/class/fields-same-line-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { 'a'; "b"; 'c' = 39; "d" = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-method-computed-names.js b/test/language/expressions/class/fields-same-line-method-computed-names.js index eb626db479..4958c0ffb5 100644 --- a/test/language/expressions/class/fields-same-line-method-computed-names.js +++ b/test/language/expressions/class/fields-same-line-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; var C = class { [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js index e063a1ab9b..bbed59a05b 100644 --- a/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { [x]; [y] = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-method-literal-names.js b/test/language/expressions/class/fields-same-line-method-literal-names.js index 70c7af3f8d..c448686a73 100644 --- a/test/language/expressions/class/fields-same-line-method-literal-names.js +++ b/test/language/expressions/class/fields-same-line-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} var C = class { a; b = 42; c = fn; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-same-line-method-private-names.js b/test/language/expressions/class/fields-same-line-method-private-names.js index 354f77ec47..d041a3e61e 100644 --- a/test/language/expressions/class/fields-same-line-method-private-names.js +++ b/test/language/expressions/class/fields-same-line-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-same-line-method.template /*--- -description: static literal private names (field definitions followed by a method in the same line) +description: private names (field definitions followed by a method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ var C = class { #x; #y; m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-same-line-method-static-private-fields.js b/test/language/expressions/class/fields-same-line-method-static-private-fields.js new file mode 100644 index 0000000000..bffbb73d9f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: static private fields (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #x; static #y; m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-method-static-private-methods.js b/test/language/expressions/class/fields-same-line-method-static-private-methods.js new file mode 100644 index 0000000000..a1c0c40cd5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: static private methods (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-method-string-literal-names.js b/test/language/expressions/class/fields-same-line-method-string-literal-names.js index e0823a9cd1..a9ae3ec04a 100644 --- a/test/language/expressions/class/fields-same-line-method-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | var C = class { 'a'; "b"; 'c' = 39; "d" = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js new file mode 100644 index 0000000000..71a013ef75 --- /dev/null +++ b/test/language/expressions/class/fields-static-comp-name-init-err-contains-arguments.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = arguments; +} diff --git a/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..49605fef46 --- /dev/null +++ b/test/language/expressions/class/fields-static-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (static computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +var C = class { + static [x] = super(); +} diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js new file mode 100644 index 0000000000..a5223c3f1d --- /dev/null +++ b/test/language/expressions/class/fields-static-literal-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = arguments; +} diff --git a/test/language/expressions/class/fields-static-literal-init-err-contains-super.js b/test/language/expressions/class/fields-static-literal-init-err-contains-super.js new file mode 100644 index 0000000000..ac49312a9c --- /dev/null +++ b/test/language/expressions/class/fields-static-literal-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static x = super(); +} diff --git a/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js new file mode 100644 index 0000000000..bcc2a49cd3 --- /dev/null +++ b/test/language/expressions/class/fields-static-private-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template +/*--- +description: Syntax error if `arguments` used in class field (static PrivateName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static #x = arguments; +} diff --git a/test/language/expressions/class/fields-static-private-init-err-contains-super.js b/test/language/expressions/class/fields-static-private-init-err-contains-super.js new file mode 100644 index 0000000000..feaf029a14 --- /dev/null +++ b/test/language/expressions/class/fields-static-private-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-private-name.template +/*--- +description: Syntax error if `super()` used in class field (static PrivateName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-private] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static #x = super(); +} diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js new file mode 100644 index 0000000000..787a945674 --- /dev/null +++ b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-arguments.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +/*--- +description: Syntax error if `arguments` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = arguments; +} diff --git a/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js new file mode 100644 index 0000000000..5a5474dce9 --- /dev/null +++ b/test/language/expressions/class/fields-static-string-literal-name-init-err-contains-super.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +/*--- +description: Syntax error if `super()` used in class field (static string literal ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public, class-static-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'x' = super(); +} diff --git a/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js b/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js index 607437f8f7..34b6bb0f90 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-computed-names.js @@ -27,7 +27,7 @@ var C = class { ;;;; ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js b/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js index ff4fc8ae92..2ac06208b5 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js @@ -28,7 +28,7 @@ var C = class { ;;;; ;;;;;;[x]; [y] = 42;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js index a12d79c9c4..01bd09b25b 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-literal-names.js @@ -28,7 +28,7 @@ var C = class { ;;;;;;a; b = 42; c = fn;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-private-names.js b/test/language/expressions/class/fields-wrapped-in-sc-private-names.js index cb551e4c88..6bdf637ffb 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-private-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-private-names.js @@ -2,23 +2,23 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- -description: static literal private names (fields definition wrapped in semicolons) +description: private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ var C = class { ;;;; ;;;;;;#x; #y;;;;;;; ;;;; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-fields.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-fields.js new file mode 100644 index 0000000000..f501112962 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-private-fields.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: static private fields (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #x; static #y;;;;;;; + ;;;; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js new file mode 100644 index 0000000000..32636c420d --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: static private methods (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js index 1260883fe3..c2f2540647 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-string-literal-names.js @@ -26,7 +26,7 @@ var C = class { ;;;;;;'a'; "b"; 'c' = 39; "d" = 42;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/expressions/class/private-fields-proxy-default-handler-throws.js b/test/language/expressions/class/private-fields-proxy-default-handler-throws.js new file mode 100644 index 0000000000..d2a26a993e --- /dev/null +++ b/test/language/expressions/class/private-fields-proxy-default-handler-throws.js @@ -0,0 +1,30 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-privatefieldget +description: Private fields not accessible via default Proxy handler +info: | + 1. Assert: P is a Private Name value. + 2. If O is not an object, throw a TypeError exception. + 3. Let entry be PrivateFieldFind(P, O). + 4. If entry is empty, throw a TypeError exception. + +features: [class, class-fields-private] +---*/ + + +var C = class { + #x = 1; + x() { + return this.#x; + } +} + +var c = new C(); +var p = new Proxy(c, {}); + +assert.sameValue(c.x(), 1); +assert.throws(TypeError, function() { + p.x(); +}); diff --git a/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js b/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js new file mode 100644 index 0000000000..9649b5406a --- /dev/null +++ b/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js @@ -0,0 +1,28 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-privatefieldget +description: Static private fields not accessible via default Proxy handler +info: | + 1. Assert: P is a Private Name value. + 2. If O is not an object, throw a TypeError exception. + 3. Let entry be PrivateFieldFind(P, O). + 4. If entry is empty, throw a TypeError exception. + +features: [class, class-static-fields-private] +---*/ + +var C = class { + static #x = 1; + static x() { + return this.#x; + } +} + +var P = new Proxy(C, {}); + +assert.sameValue(C.x, 1); +assert.throws(TypeError, function() { + P.x; +}); diff --git a/test/language/expressions/class/static-private-methods-proxy-default-handler-throws.js b/test/language/expressions/class/static-private-methods-proxy-default-handler-throws.js new file mode 100644 index 0000000000..5a26a59463 --- /dev/null +++ b/test/language/expressions/class/static-private-methods-proxy-default-handler-throws.js @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-privatefieldget +description: Static private methods not accessible via default Proxy handler +info: | + 1. Assert: P is a Private Name value. + 2. If O is not an object, throw a TypeError exception. + 3. Let entry be PrivateFieldFind(P, O). + 4. If entry is empty, throw a TypeError exception. + +features: [class, class-static-methods-private] +---*/ + + +var C = class { + static #x(value) { + return 1; + } + static x() { + return this.#x(); + } +} + +var P = new Proxy(C, {}); + +assert.sameValue(C.x(), 1); +assert.throws(TypeError, function() { + P.x(); +}); diff --git a/test/language/statements/class/fields-after-same-line-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-gen-computed-names.js index e7634a16bf..f1490e0eb0 100644 --- a/test/language/statements/class/fields-after-same-line-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js index 03529d08dc..73d1a1751f 100644 --- a/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-gen-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-literal-names.js index fd8c939e1c..277fd75c89 100644 --- a/test/language/statements/class/fields-after-same-line-gen-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-gen-private-names.js b/test/language/statements/class/fields-after-same-line-gen-private-names.js index 66bcc5a36e..1986c0342c 100644 --- a/test/language/statements/class/fields-after-same-line-gen-private-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- -description: static literal private names (field definitions after a generator in the same line) +description: private names (field definitions after a generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-fields.js b/test/language/statements/class/fields-after-same-line-gen-static-private-fields.js new file mode 100644 index 0000000000..38084c562a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: static private fields (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js new file mode 100644 index 0000000000..00ed8463be --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: static private methods (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js index 8e8cc643fc..07530985b0 100644 --- a/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-method-computed-names.js b/test/language/statements/class/fields-after-same-line-method-computed-names.js index 21fb3b86d7..6104c45f7a 100644 --- a/test/language/statements/class/fields-after-same-line-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js index 35f11d9308..5253ea022a 100644 --- a/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-method-literal-names.js b/test/language/statements/class/fields-after-same-line-method-literal-names.js index 80ecfe3208..707c6cd9f2 100644 --- a/test/language/statements/class/fields-after-same-line-method-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-method-private-names.js b/test/language/statements/class/fields-after-same-line-method-private-names.js index b241501c31..61f52545e4 100644 --- a/test/language/statements/class/fields-after-same-line-method-private-names.js +++ b/test/language/statements/class/fields-after-same-line-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- -description: static literal private names (field definitions after a method in the same line) +description: private names (field definitions after a method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-fields.js b/test/language/statements/class/fields-after-same-line-method-static-private-fields.js new file mode 100644 index 0000000000..5c3b6f6b87 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: static private fields (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-method-static-private-methods.js new file mode 100644 index 0000000000..afdbfc13c6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: static private methods (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-method-string-literal-names.js b/test/language/statements/class/fields-after-same-line-method-string-literal-names.js index 096ed952ef..1ac3f62cb6 100644 --- a/test/language/statements/class/fields-after-same-line-method-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js index 5554b63e9b..f6d8311611 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { static async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js index 6844ad7fe9..6d538d492d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { static async *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js index a98e2cea44..d6dea1573b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { static async *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js index 3f40e656f0..3262f4498c 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- -description: static literal private names (field definitions after a static async generator in the same line) +description: private names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { static async *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js new file mode 100644 index 0000000000..2e337619da --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: static private fields (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js new file mode 100644 index 0000000000..fb473a75a7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: static private methods (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js index 294388a982..6b8d8536d3 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { static async *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js index 34dfe534b0..e628b3ac56 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { static async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js index e02eb6a006..ebb19a426f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { static async m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js index 7652c546a7..6593a6c52a 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { static async m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js index bc001aa284..f37ea74df6 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- -description: static literal private names (field definitions after a static async method in the same line) +description: private names (field definitions after a static async method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { static async m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js new file mode 100644 index 0000000000..e77b50da51 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: static private fields (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js new file mode 100644 index 0000000000..755b850bd1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: static private methods (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js index dde92722fa..4ff9e092a8 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { static async m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js index 49e281bd7e..14fd13e300 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { static *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js index df6e52c392..612e4a3ea6 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { static *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js index 7ac5896575..249e98cb14 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { static *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-private-names.js b/test/language/statements/class/fields-after-same-line-static-gen-private-names.js index c6799db962..8a6a62c467 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- -description: static literal private names (field definitions after a static generator in the same line) +description: private names (field definitions after a static generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { static *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-fields.js new file mode 100644 index 0000000000..ac5e4da93d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: static private fields (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js new file mode 100644 index 0000000000..77a4f80c9a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: static private methods (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js index 2c602452be..15c7590c35 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { static *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-method-computed-names.js b/test/language/statements/class/fields-after-same-line-static-method-computed-names.js index 8ee37ce116..94975ef070 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { static m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js index d66c3d26af..81d9a231a4 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { static m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-method-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-literal-names.js index 6f9ec4a4c7..7a31a87d8b 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { static m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-after-same-line-static-method-private-names.js b/test/language/statements/class/fields-after-same-line-static-method-private-names.js index e270cbe507..9f118b185e 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- -description: static literal private names (field definitions after a static method in the same line) +description: private names (field definitions after a static method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { static m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-fields.js new file mode 100644 index 0000000000..847fbe5747 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: static private fields (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js new file mode 100644 index 0000000000..8c13b7e74f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: static private methods (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js index 8c0c9b2a5b..28798be2f6 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { static m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js b/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js new file mode 100644 index 0000000000..54fe419111 --- /dev/null +++ b/test/language/statements/class/fields-comp-name-init-err-contains-arguments.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-arguments.case +// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template +/*--- +description: Syntax error if `arguments` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if ContainsArguments of Initializer is true. + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + [x] = arguments; +} diff --git a/test/language/statements/class/fields-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-comp-name-init-err-contains-super.js new file mode 100644 index 0000000000..96026dddc9 --- /dev/null +++ b/test/language/statements/class/fields-comp-name-init-err-contains-super.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-contains-super.case +// - src/class-fields/initializer-error/cls-decl-fields-comp-name.template +/*--- +description: Syntax error if `super()` used in class field (computed ClassElementName) +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + Static Semantics: Early Errors + + FieldDefinition: + PropertyNameInitializeropt + + - It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true. + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var x = "string"; +class C { + [x] = super(); +} diff --git a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js index 5c9639bc9e..8818450017 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js @@ -4,7 +4,7 @@ /*--- description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, Symbol, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, Symbol, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/statements/class/fields-computed-name-toprimitive.js b/test/language/statements/class/fields-computed-name-toprimitive.js index 518f1f164d..c986cd012d 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive.js +++ b/test/language/statements/class/fields-computed-name-toprimitive.js @@ -4,7 +4,7 @@ /*--- description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) esid: prod-FieldDefinition -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/statements/class/fields-computed-variable-name-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-propname-constructor.js deleted file mode 100644 index 2b7aa5a78e..0000000000 --- a/test/language/statements/class/fields-computed-variable-name-propname-constructor.js +++ /dev/null @@ -1,33 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/propname-constructor.case -// - src/class-fields/propname-error/cls-decl-variable-name.template -/*--- -description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -flags: [generated] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "constructor". - ----*/ - - -var constructor = 'foo'; -class C { - [constructor]; -} - -var c = new C(); - -assert.sameValue(c.hasOwnProperty("foo"), true); -assert.sameValue(C.hasOwnProperty("foo"), false); diff --git a/test/language/statements/class/fields-ctor-called-after-fields-init.js b/test/language/statements/class/fields-ctor-called-after-fields-init.js index e9c44bb1bb..9633a3bbd8 100644 --- a/test/language/statements/class/fields-ctor-called-after-fields-init.js +++ b/test/language/statements/class/fields-ctor-called-after-fields-init.js @@ -4,7 +4,7 @@ /*--- description: The constructor method is called after the fields are initalized (field definitions in a class declaration) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] info: | [[Construct]] ( argumentsList, newTarget) diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js index ec3eae5459..7520e6546f 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js @@ -23,9 +23,8 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; super()["x"];'); } diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js index bd7c9757e3..75612496c5 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js @@ -7,13 +7,6 @@ esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. ScriptBody:StatementList @@ -23,9 +16,8 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; super().x;'); } diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js index 3e988d94fe..c5f63012a8 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js @@ -23,9 +23,8 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; super();'); } diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js index 7f3963b1f4..ca04c448dc 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -23,9 +23,8 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; super.x;'); } diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js index b6df495eb2..be58a46774 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -2,30 +2,26 @@ // - src/class-fields/eval-err-contains-superproperty-2.case // - src/class-fields/initializer-eval-super-property/cls-decl-fields-eval.template /*--- -description: error if `super['x']` in StatementList of eval (direct eval) +description: error if super['x'] in StatementList of eval (direct eval) esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods - These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. ---*/ -class A {} - var executed = false; +class A {} class C extends A { x = eval('executed = true; super["x"];'); } diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index 16b468837b..7ee11c41d4 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-1.case -// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template /*--- description: error if `super()['x']` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -23,11 +23,10 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { - x = (0, eval)('executed = true; super()["x"];'); + #x = (0, eval)('executed = true; super()["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index b7492996cd..9de84949fd 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -1,19 +1,12 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-2.case -// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template /*--- description: error if `super().x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. - Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. ScriptBody:StatementList @@ -23,11 +16,10 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { - x = (0, eval)('executed = true; super().x;'); + #x = (0, eval)('executed = true; super().x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index d3554fe954..1ba08ba625 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall.case -// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template /*--- description: error if `super()` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -23,11 +23,10 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { - x = (0, eval)('executed = true; super();'); + #x = (0, eval)('executed = true; super();'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index e71f434467..c2520d7416 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-1.case -// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template /*--- description: error if `super.x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -23,11 +23,10 @@ info: | ---*/ -class A {} - var executed = false; +class A {} class C extends A { - x = (0, eval)('executed = true; super.x;'); + #x = (0, eval)('executed = true; super.x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js index ee79439a68..2ed9f8c6a1 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -1,33 +1,29 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-2.case -// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template /*--- -description: error if `super['x']` in StatementList of eval (indirect eval) +description: error if super['x'] in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer features: [class, class-fields-public] flags: [generated] info: | - Additional Early Error Rules for Eval Inside Initializer - These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. - ScriptBody : StatementList - - ... - The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. Additional Early Error Rules for Eval Outside Methods - These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. ---*/ -class A {} - var executed = false; +class A {} class C extends A { - x = (0, eval)('executed = true; super["x"];'); + #x = (0, eval)('executed = true; super["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js b/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js index e24b384878..d0768c666d 100644 --- a/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js @@ -4,7 +4,7 @@ /*--- description: error if `new.target` in StatementList of eval (direct eval) esid: sec-performeval-rules-in-initializer -features: [class, class-fields-public, new.target] +features: [class, new.target, class-fields-public] flags: [generated] info: | Additional Early Error Rules for Eval Inside Initializer diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js b/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js index 505de6f4b9..c0771fa335 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js @@ -4,7 +4,7 @@ /*--- description: ReferenceError evaluating a computed property name (field definitions in a class declaration) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js index 77579a2f60..f3b1fa0312 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class declaration) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, Symbol.toPrimitive, class, class-fields-public] +features: [computed-property-names, Symbol.toPrimitive, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js new file mode 100644 index 0000000000..8f5b5d5b16 --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-noncallable.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-returns-noncallable.case +// - src/class-fields/class-evaluation-error/cls-decl.template +/*--- +description: Custom error evaluating a computed property name (field definitions in a class declaration) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, Symbol.toPrimitive, class] +flags: [generated] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ... + 27. For each ClassElement e in order from elements + a. If IsStatic of me is false, then + i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). + ... + + Runtime Semantics: ClassElementEvaluation + + ClassElement: FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. + + Runtime Semantics: ClassFieldDefinitionEvaluation + With parameters isStatic and homeObject. + + 1. Let fieldName be the result of evaluating ClassElementName. + 2. ReturnIfAbrupt(fieldName). + ... + + Runtime Semantics: Evaluation + ComputedPropertyName: [ AssignmentExpression ] + + 1. Let exprValue be the result of evaluating AssignmentExpression. + 2. Let propName be ? GetValue(exprValue). + 3. Return ? ToPropertyKey(propName). + +---*/ +var obj = { + [Symbol.toPrimitive]: {} +}; + + + +function evaluate() { + class C { + [obj] = refErrorIfEvaluated; + } +} + +assert.throws(TypeError +, evaluate); diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js new file mode 100644 index 0000000000..de9c94b7de --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-returns-nonobject.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-returns-nonobject.case +// - src/class-fields/class-evaluation-error/cls-decl.template +/*--- +description: Custom error evaluating a computed property name (field definitions in a class declaration) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, Symbol.toPrimitive, class] +flags: [generated] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + ... + 27. For each ClassElement e in order from elements + a. If IsStatic of me is false, then + i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. + b. Else, + i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. + c. If fields is an abrupt completion, then + i. Set the running execution context's LexicalEnvironment to lex. + ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. + iii. Return Completion(status). + ... + + Runtime Semantics: ClassElementEvaluation + + ClassElement: FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter false and object. + + Runtime Semantics: ClassFieldDefinitionEvaluation + With parameters isStatic and homeObject. + + 1. Let fieldName be the result of evaluating ClassElementName. + 2. ReturnIfAbrupt(fieldName). + ... + + Runtime Semantics: Evaluation + ComputedPropertyName: [ AssignmentExpression ] + + 1. Let exprValue be the result of evaluating AssignmentExpression. + 2. Let propName be ? GetValue(exprValue). + 3. Return ? ToPropertyKey(propName). + +---*/ +var obj = { + [Symbol.toPrimitive]: 42 +}; + + + +function evaluate() { + class C { + [obj] = refErrorIfEvaluated; + } +} + +assert.throws(TypeError, evaluate); diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js index 2edbc79dbe..1390e7639e 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class declaration) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js b/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js index b056fb488e..86d37c3dda 100644 --- a/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js +++ b/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js @@ -4,7 +4,7 @@ /*--- description: Custom error evaluating a computed property name (field definitions in a class declaration) esid: sec-runtime-semantics-classdefinitionevaluation -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] info: | Runtime Semantics: ClassDefinitionEvaluation diff --git a/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js b/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js index fb408f497d..3296a5902e 100644 --- a/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js @@ -4,7 +4,7 @@ /*--- description: error if `new.target` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer -features: [class, class-fields-public, new.target] +features: [class, new.target, class-fields-public] flags: [generated] info: | Additional Early Error Rules for Eval Inside Initializer diff --git a/test/language/statements/class/fields-init-err-evaluation.js b/test/language/statements/class/fields-init-err-evaluation.js index 67c9b0200b..96eaebeb9a 100644 --- a/test/language/statements/class/fields-init-err-evaluation.js +++ b/test/language/statements/class/fields-init-err-evaluation.js @@ -4,7 +4,7 @@ /*--- description: Return abrupt completion evaluating the field initializer (field definitions in a class declaration) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] info: | [[Construct]] ( argumentsList, newTarget) diff --git a/test/language/statements/class/fields-init-value-defined-after-class.js b/test/language/statements/class/fields-init-value-defined-after-class.js index 8c8eac3a26..4555de6efc 100644 --- a/test/language/statements/class/fields-init-value-defined-after-class.js +++ b/test/language/statements/class/fields-init-value-defined-after-class.js @@ -4,7 +4,7 @@ /*--- description: The initializer value is defined after the class evaluation (field definitions in a class declaration) esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/statements/class/fields-init-value-incremental.js b/test/language/statements/class/fields-init-value-incremental.js index 24d5eb3b6f..efbb803480 100644 --- a/test/language/statements/class/fields-init-value-incremental.js +++ b/test/language/statements/class/fields-init-value-incremental.js @@ -4,7 +4,7 @@ /*--- description: The initializer value is defined during the class instatiation (field definitions in a class declaration) esid: prod-FieldDefinition -features: [computed-property-names, class, class-fields-public] +features: [computed-property-names, class] flags: [generated] includes: [propertyHelper.js] info: | diff --git a/test/language/statements/class/fields-multiple-definitions-computed-names.js b/test/language/statements/class/fields-multiple-definitions-computed-names.js index b6d3cfb14f..dd750df16c 100644 --- a/test/language/statements/class/fields-multiple-definitions-computed-names.js +++ b/test/language/statements/class/fields-multiple-definitions-computed-names.js @@ -29,7 +29,7 @@ class C { [x] = 42; [10] = "meep"; ["not initialized"] m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js b/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js index 813aac64b2..1ff9fb2327 100644 --- a/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js +++ b/test/language/statements/class/fields-multiple-definitions-computed-symbol-names.js @@ -30,7 +30,7 @@ class C { [x]; [y] = 42 m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-definitions-literal-names.js b/test/language/statements/class/fields-multiple-definitions-literal-names.js index 63d8ad694c..b80d396c39 100644 --- a/test/language/statements/class/fields-multiple-definitions-literal-names.js +++ b/test/language/statements/class/fields-multiple-definitions-literal-names.js @@ -30,7 +30,7 @@ class C { c = fn m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-definitions-private-names.js b/test/language/statements/class/fields-multiple-definitions-private-names.js index 6ea8e96278..e0e0a3c3b2 100644 --- a/test/language/statements/class/fields-multiple-definitions-private-names.js +++ b/test/language/statements/class/fields-multiple-definitions-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- -description: static literal private names (multiple fields definitions) +description: private names (multiple fields definitions) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -30,7 +30,7 @@ class C { #x; #y m2() { return 39 } bar = "barbaz"; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-fields.js b/test/language/statements/class/fields-multiple-definitions-static-private-fields.js new file mode 100644 index 0000000000..d257631dde --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-private-fields.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: static private fields (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #x; static #y + m2() { return 39 } + bar = "barbaz"; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-methods.js b/test/language/statements/class/fields-multiple-definitions-static-private-methods.js new file mode 100644 index 0000000000..df86d9893d --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-private-methods.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: static private methods (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #xVal; static #yVal + m2() { return 39 } + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-definitions-string-literal-names.js b/test/language/statements/class/fields-multiple-definitions-string-literal-names.js index 8ce2d2fd05..cc297096e4 100644 --- a/test/language/statements/class/fields-multiple-definitions-string-literal-names.js +++ b/test/language/statements/class/fields-multiple-definitions-string-literal-names.js @@ -28,7 +28,7 @@ class C { "d" = 42 m2() { return 39 } bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js index 1bdcb8e773..b6f884a84f 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-computed-names.js @@ -27,7 +27,7 @@ class C { [x] = 42; [10] = "meep"; ["not initialized"] foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js index 9bfeb243fc..76a7d9f7a7 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js @@ -28,7 +28,7 @@ class C { [x]; [y] = 42 foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js index db7c211752..59dd6f45f1 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names.js @@ -28,7 +28,7 @@ class C { c = fn foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-private-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-private-names.js index e88d530aca..46914e9068 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-private-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- -description: static literal private names (multiple stacked fields definitions through ASI) +description: private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -28,7 +28,7 @@ class C { #x; #y foo = "foobar" bar = "barbaz"; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-fields.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-fields.js new file mode 100644 index 0000000000..b2d30bb684 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-fields.js @@ -0,0 +1,80 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: static private fields (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y + foo = "foobar" + bar = "barbaz"; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js new file mode 100644 index 0000000000..9e38dfbc91 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: static private methods (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + foo = "foobar" + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js index fffb53f4f1..e65d06e981 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js @@ -26,7 +26,7 @@ class C { "d" = 42 foo = "foobar" bar = "barbaz"; - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js b/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js index 656dad2c1a..40dcc6bc94 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"] m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js b/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js index 803d75477e..3670093d19 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); class C { [x]; [y] = 42 m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js index ae718c8241..85571fd558 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-literal-names.js @@ -27,7 +27,7 @@ class C { a; b = 42; c = fn m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-private-names.js b/test/language/statements/class/fields-new-no-sc-line-method-private-names.js index f57b9ac5bb..ddb2b385ca 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-private-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- -description: static literal private names (field definitions followed by a method in a new line without a semicolon) +description: private names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | class C { #x; #y m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-fields.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-fields.js new file mode 100644 index 0000000000..21a082f6d5 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: static private fields (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y + m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js new file mode 100644 index 0000000000..6b444eb326 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: static private methods (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js index e376980dfc..606f9857cd 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-string-literal-names.js @@ -25,7 +25,7 @@ class C { 'a'; "b"; 'c' = 39; "d" = 42 m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-gen-computed-names.js b/test/language/statements/class/fields-new-sc-line-gen-computed-names.js index ed18ea80b9..dac45df434 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js index 3c8a55c93b..e18acba62c 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); class C { [x]; [y] = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-gen-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-literal-names.js index 65966a09cb..33764b72e5 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-literal-names.js @@ -27,7 +27,7 @@ class C { a; b = 42; c = fn; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-gen-private-names.js b/test/language/statements/class/fields-new-sc-line-gen-private-names.js index 540ad191c9..fe4b9d8fa5 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-private-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- -description: static literal private names (field definitions followed by a method in a new line with a semicolon) +description: private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | class C { #x; #y; *m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-fields.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-fields.js new file mode 100644 index 0000000000..fc2cdc56ce --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: static private fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y; + *m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js new file mode 100644 index 0000000000..c1bf2164e0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: static private methods (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; + *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js index 2409d6ae0b..1e8ff0f814 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-string-literal-names.js @@ -25,7 +25,7 @@ class C { 'a'; "b"; 'c' = 39; "d" = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-method-computed-names.js b/test/language/statements/class/fields-new-sc-line-method-computed-names.js index a3055504f0..27d235a721 100644 --- a/test/language/statements/class/fields-new-sc-line-method-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-computed-names.js @@ -26,7 +26,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js index 1e305c017d..6377c3578b 100644 --- a/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-computed-symbol-names.js @@ -27,7 +27,7 @@ var y = Symbol(); class C { [x]; [y] = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-method-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-literal-names.js index 96b9f225a3..7c2d3b0a39 100644 --- a/test/language/statements/class/fields-new-sc-line-method-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-literal-names.js @@ -27,7 +27,7 @@ class C { a; b = 42; c = fn; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-new-sc-line-method-private-names.js b/test/language/statements/class/fields-new-sc-line-method-private-names.js index 9b095ec504..2801a349d1 100644 --- a/test/language/statements/class/fields-new-sc-line-method-private-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-private-names.js @@ -2,24 +2,24 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- -description: static literal private names (field definitions followed by a method in a new line with a semicolon) +description: private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ info: | class C { #x; #y; m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-fields.js b/test/language/statements/class/fields-new-sc-line-method-static-private-fields.js new file mode 100644 index 0000000000..77c05cade6 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-private-fields.js @@ -0,0 +1,67 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: static private fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y; + m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js b/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js new file mode 100644 index 0000000000..eb7d9e137e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: static private methods (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js index 9377cf7593..a5ebd2808c 100644 --- a/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-string-literal-names.js @@ -25,7 +25,7 @@ class C { 'a'; "b"; 'c' = 39; "d" = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-private-direct-eval-err-contains-arguments.js b/test/language/statements/class/fields-private-direct-eval-err-contains-arguments.js new file mode 100644 index 0000000000..366efed2fc --- /dev/null +++ b/test/language/statements/class/fields-private-direct-eval-err-contains-arguments.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-arguments.case +// - src/class-fields/initializer-eval-arguments/cls-decl-private-fields-eval.template +/*--- +description: error if `arguments` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + It is a Syntax Error if ContainsArguments of StatementList is true. + ... + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +var executed = false; +class C { + #x = eval('executed = true; arguments;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js b/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js new file mode 100644 index 0000000000..d44434ad17 --- /dev/null +++ b/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-newtarget.case +// - src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-eval.template +/*--- +description: error if `new.target` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, new.target, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Functions + These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. + ScriptBody:StatementList + + It is a Syntax Error if StatementList Contains NewTarget. + +---*/ + + +var executed = false; +class C { + #x = eval('executed = true; new.target;'); +} + +var c = new C(); + +assert.sameValue(executed, true); +assert.sameValue(c.x, undefined); diff --git a/test/language/statements/class/fields-private-indirect-eval-err-contains-arguments.js b/test/language/statements/class/fields-private-indirect-eval-err-contains-arguments.js new file mode 100644 index 0000000000..dee4e5946f --- /dev/null +++ b/test/language/statements/class/fields-private-indirect-eval-err-contains-arguments.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-arguments.case +// - src/class-fields/initializer-eval-arguments/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `arguments` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + It is a Syntax Error if ContainsArguments of StatementList is true. + ... + + Static Semantics: ContainsArguments + IdentifierReference : Identifier + + 1. If the StringValue of Identifier is "arguments", return true. + ... + For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. + +---*/ + + +var executed = false; +class C { + #x = (0, eval)('executed = true; arguments;'); +} + +assert.throws(ReferenceError, function() { + new C(); +}); + +assert.sameValue(executed, true); diff --git a/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js b/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js new file mode 100644 index 0000000000..c15dd203a9 --- /dev/null +++ b/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-newtarget.case +// - src/class-fields/initializer-eval-newtarget/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `new.target` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, new.target, class-fields-private] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Functions + These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. + ScriptBody:StatementList + + It is a Syntax Error if StatementList Contains NewTarget. + +---*/ + + +var executed = false; +class C { + #x = (0, eval)('executed = true; new.target;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-redeclaration-symbol.js b/test/language/statements/class/fields-redeclaration-symbol.js index 5d3337f356..9995556e8b 100644 --- a/test/language/statements/class/fields-redeclaration-symbol.js +++ b/test/language/statements/class/fields-redeclaration-symbol.js @@ -4,7 +4,7 @@ /*--- description: Redeclaration of public fields with the same name (field definitions in a class declaration) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] includes: [propertyHelper.js, compareArray.js] info: | diff --git a/test/language/statements/class/fields-redeclaration.js b/test/language/statements/class/fields-redeclaration.js index 3cc850ada8..236e683714 100644 --- a/test/language/statements/class/fields-redeclaration.js +++ b/test/language/statements/class/fields-redeclaration.js @@ -4,7 +4,7 @@ /*--- description: Redeclaration of public fields with the same name (field definitions in a class declaration) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class] flags: [generated] includes: [propertyHelper.js, compareArray.js] info: | diff --git a/test/language/statements/class/fields-regular-definitions-computed-names.js b/test/language/statements/class/fields-regular-definitions-computed-names.js index 7fa89ad913..485a382e49 100644 --- a/test/language/statements/class/fields-regular-definitions-computed-names.js +++ b/test/language/statements/class/fields-regular-definitions-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"] - + } var c = new C(); diff --git a/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js b/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js index 88c2d21f64..49e1b31638 100644 --- a/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js +++ b/test/language/statements/class/fields-regular-definitions-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { [x]; [y] = 42 - + } var c = new C(); diff --git a/test/language/statements/class/fields-regular-definitions-literal-names.js b/test/language/statements/class/fields-regular-definitions-literal-names.js index 170ab303d6..bb7dc4cbf4 100644 --- a/test/language/statements/class/fields-regular-definitions-literal-names.js +++ b/test/language/statements/class/fields-regular-definitions-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { a; b = 42; c = fn - + } var c = new C(); diff --git a/test/language/statements/class/fields-regular-definitions-private-names.js b/test/language/statements/class/fields-regular-definitions-private-names.js index 2c482495a0..414c963995 100644 --- a/test/language/statements/class/fields-regular-definitions-private-names.js +++ b/test/language/statements/class/fields-regular-definitions-private-names.js @@ -2,30 +2,30 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-regular-definitions.template /*--- -description: static literal private names (regular fields defintion) +description: private names (regular fields defintion) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { #x; #y -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-static-private-fields.js b/test/language/statements/class/fields-regular-definitions-static-private-fields.js similarity index 75% rename from test/language/statements/class/fields-static-private-fields.js rename to test/language/statements/class/fields-regular-definitions-static-private-fields.js index a9b0611ee4..11cbfcf788 100644 --- a/test/language/statements/class/fields-static-private-fields.js +++ b/test/language/statements/class/fields-regular-definitions-static-private-fields.js @@ -1,23 +1,23 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-fields.case -// - src/class-fields/default/cls-decl.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- -description: literal private names (field definitions in a class declaration) +description: static private fields (regular fields defintion) esid: prod-FieldDefinition -features: [class, class-fields-public] +features: [class-static-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... static FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName ---*/ @@ -25,8 +25,18 @@ info: | class C { static #x; static #y + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } } +var c = new C(); + // Test the private fields do not appear as properties before set to value assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); diff --git a/test/language/statements/class/fields-regular-definitions-static-private-methods.js b/test/language/statements/class/fields-regular-definitions-static-private-methods.js new file mode 100644 index 0000000000..74b7858c7b --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-static-private-methods.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: static private methods (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-regular-definitions-string-literal-names.js b/test/language/statements/class/fields-regular-definitions-string-literal-names.js index cc8ea7ce7d..cc177acd57 100644 --- a/test/language/statements/class/fields-regular-definitions-string-literal-names.js +++ b/test/language/statements/class/fields-regular-definitions-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { 'a'; "b"; 'c' = 39; "d" = 42 - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-names.js index 7e8cf65202..9dd54fa739 100644 --- a/test/language/statements/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { async *m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js index 061aa74474..948d23c827 100644 --- a/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { async *m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-gen-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-literal-names.js index 14e3dc66cd..4ca55d8d96 100644 --- a/test/language/statements/class/fields-same-line-async-gen-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { async *m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-gen-private-names.js b/test/language/statements/class/fields-same-line-async-gen-private-names.js index a1c4b00def..adbd03e6c6 100644 --- a/test/language/statements/class/fields-same-line-async-gen-private-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- -description: static literal private names (field definitions after an async generator in the same line) +description: private names (field definitions after an async generator in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { async *m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js b/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js new file mode 100644 index 0000000000..25507fab39 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js @@ -0,0 +1,70 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: static private fields (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async *m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js b/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js new file mode 100644 index 0000000000..56dec2a2ee --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js @@ -0,0 +1,76 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: static private methods (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js index 01a18bebd9..759eb62bd1 100644 --- a/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { async *m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-method-computed-names.js b/test/language/statements/class/fields-same-line-async-method-computed-names.js index ab68ccb314..f68257e2a0 100644 --- a/test/language/statements/class/fields-same-line-async-method-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { async m() { return 42; } [x] = 42; [10] = "meep"; ["not initialized"]; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js index 4c0e85f0bc..11eda8bd65 100644 --- a/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { async m() { return 42; } [x]; [y] = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-method-literal-names.js b/test/language/statements/class/fields-same-line-async-method-literal-names.js index 056461df19..a479fdd3c3 100644 --- a/test/language/statements/class/fields-same-line-async-method-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { async m() { return 42; } a; b = 42; c = fn; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-async-method-private-names.js b/test/language/statements/class/fields-same-line-async-method-private-names.js index 5735b08153..9f58eb22d2 100644 --- a/test/language/statements/class/fields-same-line-async-method-private-names.js +++ b/test/language/statements/class/fields-same-line-async-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- -description: static literal private names (field definitions after an async method in the same line) +description: private names (field definitions after an async method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { async m() { return 42; } #x; #y; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-fields.js b/test/language/statements/class/fields-same-line-async-method-static-private-fields.js new file mode 100644 index 0000000000..3530b98d0f --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-private-fields.js @@ -0,0 +1,69 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: static private fields (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async m() { return 42; } static #x; static #y; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-methods.js b/test/language/statements/class/fields-same-line-async-method-static-private-methods.js new file mode 100644 index 0000000000..15a37aa86d --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-private-methods.js @@ -0,0 +1,75 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: static private methods (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-string-literal-names.js b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js index 18986604f0..31354912cc 100644 --- a/test/language/statements/class/fields-same-line-async-method-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { async m() { return 42; } 'a'; "b"; 'c' = 39; "d" = 42; - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-gen-computed-names.js b/test/language/statements/class/fields-same-line-gen-computed-names.js index bfd85d84ad..ac6ca3430b 100644 --- a/test/language/statements/class/fields-same-line-gen-computed-names.js +++ b/test/language/statements/class/fields-same-line-gen-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"]; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js b/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js index 82b5440f04..1e3724bf92 100644 --- a/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-gen-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { [x]; [y] = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-gen-literal-names.js b/test/language/statements/class/fields-same-line-gen-literal-names.js index a473fda3f4..4e3c4e3d72 100644 --- a/test/language/statements/class/fields-same-line-gen-literal-names.js +++ b/test/language/statements/class/fields-same-line-gen-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { a; b = 42; c = fn; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-gen-private-names.js b/test/language/statements/class/fields-same-line-gen-private-names.js index 435c2c8fd9..20a6fc1474 100644 --- a/test/language/statements/class/fields-same-line-gen-private-names.js +++ b/test/language/statements/class/fields-same-line-gen-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-same-line-generator.template /*--- -description: static literal private names (field definitions followed by a generator method in the same line) +description: private names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { #x; #y; *m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-same-line-gen-static-private-fields.js b/test/language/statements/class/fields-same-line-gen-static-private-fields.js new file mode 100644 index 0000000000..30df3ef646 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: static private fields (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y; *m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-gen-static-private-methods.js b/test/language/statements/class/fields-same-line-gen-static-private-methods.js new file mode 100644 index 0000000000..a1c6037d4f --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: static private methods (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-gen-string-literal-names.js b/test/language/statements/class/fields-same-line-gen-string-literal-names.js index 2b86174641..f4b52e635c 100644 --- a/test/language/statements/class/fields-same-line-gen-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-gen-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { 'a'; "b"; 'c' = 39; "d" = 42; *m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-method-computed-names.js b/test/language/statements/class/fields-same-line-method-computed-names.js index b9b64e5424..f5dbafb308 100644 --- a/test/language/statements/class/fields-same-line-method-computed-names.js +++ b/test/language/statements/class/fields-same-line-method-computed-names.js @@ -25,7 +25,7 @@ var x = "b"; class C { [x] = 42; [10] = "meep"; ["not initialized"]; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-method-computed-symbol-names.js b/test/language/statements/class/fields-same-line-method-computed-symbol-names.js index ee373b465d..4080a9897b 100644 --- a/test/language/statements/class/fields-same-line-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-method-computed-symbol-names.js @@ -26,7 +26,7 @@ var y = Symbol(); class C { [x]; [y] = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-method-literal-names.js b/test/language/statements/class/fields-same-line-method-literal-names.js index e3caff61aa..95c05ce2a3 100644 --- a/test/language/statements/class/fields-same-line-method-literal-names.js +++ b/test/language/statements/class/fields-same-line-method-literal-names.js @@ -26,7 +26,7 @@ const fn = function() {} class C { a; b = 42; c = fn; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-same-line-method-private-names.js b/test/language/statements/class/fields-same-line-method-private-names.js index 070db9093b..2a66f071fe 100644 --- a/test/language/statements/class/fields-same-line-method-private-names.js +++ b/test/language/statements/class/fields-same-line-method-private-names.js @@ -2,31 +2,31 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-same-line-method.template /*--- -description: static literal private names (field definitions followed by a method in the same line) +description: private names (field definitions followed by a method in the same line) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ class C { #x; #y; m() { return 42; } -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-same-line-method-static-private-fields.js b/test/language/statements/class/fields-same-line-method-static-private-fields.js new file mode 100644 index 0000000000..6894e6f7ab --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-private-fields.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: static private fields (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #x; static #y; m() { return 42; } + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private fields do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-method-static-private-methods.js b/test/language/statements/class/fields-same-line-method-static-private-methods.js new file mode 100644 index 0000000000..fd2bf8fd76 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-private-methods.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: static private methods (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-method-string-literal-names.js b/test/language/statements/class/fields-same-line-method-string-literal-names.js index 50ffafe2f9..fca2d77d11 100644 --- a/test/language/statements/class/fields-same-line-method-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-method-string-literal-names.js @@ -24,7 +24,7 @@ info: | class C { 'a'; "b"; 'c' = 39; "d" = 42; m() { return 42; } - + } var c = new C(); diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js index 666a41ca8b..a18b90f529 100644 --- a/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-arguments.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `arguments` used in class field (static computed ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js index 12d148d613..258c0dbd2b 100644 --- a/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js +++ b/test/language/statements/class/fields-static-comp-name-init-err-contains-super.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `super()` used in class field (static computed ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js b/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js index cd4f184292..449f385889 100644 --- a/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js +++ b/test/language/statements/class/fields-static-literal-init-err-contains-arguments.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `arguments` used in class field (static literal ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-literal-init-err-contains-super.js b/test/language/statements/class/fields-static-literal-init-err-contains-super.js index 64334ba094..fb04feabb5 100644 --- a/test/language/statements/class/fields-static-literal-init-err-contains-super.js +++ b/test/language/statements/class/fields-static-literal-init-err-contains-super.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `super()` used in class field (static literal ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-private-init-err-contains-arguments.js b/test/language/statements/class/fields-static-private-init-err-contains-arguments.js index dc4b9a96bd..97f0d66ed0 100644 --- a/test/language/statements/class/fields-static-private-init-err-contains-arguments.js +++ b/test/language/statements/class/fields-static-private-init-err-contains-arguments.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `arguments` used in class field (static PrivateName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-private] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-private-init-err-contains-super.js b/test/language/statements/class/fields-static-private-init-err-contains-super.js index 19423553ea..475696926c 100644 --- a/test/language/statements/class/fields-static-private-init-err-contains-super.js +++ b/test/language/statements/class/fields-static-private-init-err-contains-super.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `super()` used in class field (static PrivateName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-private] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js index c44b995641..5c3decb179 100644 --- a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-arguments.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `arguments` used in class field (static string literal ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js index 39cf2cb52a..b0d5dc66bb 100644 --- a/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js +++ b/test/language/statements/class/fields-static-string-literal-name-init-err-contains-super.js @@ -4,7 +4,7 @@ /*--- description: Syntax error if `super()` used in class field (static string literal ClassElementName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-fields-public, class-static-fields-public] flags: [generated] negative: phase: parse diff --git a/test/language/statements/class/fields-wrapped-in-sc-computed-names.js b/test/language/statements/class/fields-wrapped-in-sc-computed-names.js index 69b5bce833..5ab17511d1 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-computed-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-computed-names.js @@ -27,7 +27,7 @@ class C { ;;;; ;;;;;;[x] = 42; [10] = "meep"; ["not initialized"];;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js b/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js index cef596bb74..e81f993692 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js @@ -28,7 +28,7 @@ class C { ;;;; ;;;;;;[x]; [y] = 42;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/statements/class/fields-wrapped-in-sc-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-literal-names.js index caf9edbe98..2364d417b6 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-literal-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-literal-names.js @@ -28,7 +28,7 @@ class C { ;;;;;;a; b = 42; c = fn;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/statements/class/fields-wrapped-in-sc-private-names.js b/test/language/statements/class/fields-wrapped-in-sc-private-names.js index 440650c832..5a8130a5cc 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-private-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-private-names.js @@ -2,23 +2,23 @@ // - src/class-fields/private-names.case // - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- -description: static literal private names (fields definition wrapped in semicolons) +description: private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition features: [class-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: - #IdentifierName + PrivateName : + # IdentifierName ---*/ @@ -27,7 +27,7 @@ class C { ;;;; ;;;;;;#x; #y;;;;;;; ;;;; -x() { + x() { this.#x = 42; return this.#x; } diff --git a/test/language/statements/class/fields-static-private-methods.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-fields.js similarity index 69% rename from test/language/statements/class/fields-static-private-methods.js rename to test/language/statements/class/fields-wrapped-in-sc-static-private-fields.js index 3bf11c26da..02eade5d9d 100644 --- a/test/language/statements/class/fields-static-private-methods.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-private-fields.js @@ -1,32 +1,44 @@ // This file was procedurally generated from the following sources: -// - src/class-fields/static-private-methods.case -// - src/class-fields/default/cls-decl.template +// - src/class-fields/static-private-fields.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- -description: literal private names (field definitions in a class declaration) +description: static private fields (fields definition wrapped in semicolons) esid: prod-FieldDefinition -features: [class-static-methods-private, class, class-fields-public] +features: [class-static-fields-private, class, class-fields-public] flags: [generated] info: | - ClassElement: + ClassElement : ... static FieldDefinition ; - FieldDefinition: + FieldDefinition : ClassElementName Initializer_opt - ClassElementName: + ClassElementName : PrivateName - PrivateName: + PrivateName : # IdentifierName ---*/ class C { - static #xVal; static #yVal + ;;;; + ;;;;;;static #x; static #y;;;;;;; + ;;;; + static x() { + this.#x = 42; + return this.#x; + } + static y() { + this.#y = 43; + return this.#y; + } } +var c = new C(); + // Test the private fields do not appear as properties before set to value assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js new file mode 100644 index 0000000000..1ad7a3ab04 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js @@ -0,0 +1,63 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: static private methods (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + ;;;; + ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#y = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 7"); +assert.sameValue(C.y(), 43, "test 8"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); diff --git a/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js index e1ba62e970..1acfc2fe29 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-string-literal-names.js @@ -26,7 +26,7 @@ class C { ;;;;;;'a'; "b"; 'c' = 39; "d" = 42;;;;;;; ;;;; - + } var c = new C(); diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js index 58c14e57dc..bfff8da44e 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-7.js @@ -9,7 +9,7 @@ info: | 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. -features: [class-fields-private] +features: [class, class-fields-private] negative: phase: parse type: SyntaxError diff --git a/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js b/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js index c134b47409..467b5ed045 100644 --- a/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js +++ b/test/language/statements/class/privatename-not-valid-earlyerr-script-8.js @@ -9,7 +9,7 @@ info: | 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. -features: [class-fields-private] +features: [class, class-fields-private] negative: phase: parse type: SyntaxError From c794f43af3b7aa8bb32ae31e288cc007a17d7ba0 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 6 Aug 2018 13:58:32 -0400 Subject: [PATCH 21/40] Class Fields: extensive static and runtime production verification cases & templates --- ...ield-classelementname-initializer-alt.case | 68 +++++++++++ ...ar-field-classelementname-initializer.case | 68 +++++++++++ ...field-def-has-initializer-no-sc-error.case | 27 +++++ .../grammar-field-identifier-alt.case | 68 +++++++++++ ...ar-field-identifier-invalid-ues-error.case | 63 ++++++++++ ...ar-field-identifier-invalid-zwj-error.case | 63 ++++++++++ ...r-field-identifier-invalid-zwnj-error.case | 63 ++++++++++ .../grammar-field-identifier.case | 68 +++++++++++ .../grammar-fields-multi-line.case | 27 +++++ .../grammar-fields-same-line-error.case | 26 +++++ ...name-classelementname-initializer-alt.case | 65 +++++++++++ ...vatename-classelementname-initializer.case | 65 +++++++++++ .../grammar-privatename-error.case | 29 +++++ ...ar-privatename-identifier-invalid-ues.case | 57 +++++++++ ...vatename-identifier-invalid-zwj-error.case | 58 ++++++++++ ...atename-identifier-invalid-zwnj-error.case | 58 ++++++++++ ...name-identifier-semantics-stringvalue.case | 91 +++++++++++++++ .../grammar-privatename-identifier.case | 62 ++++++++++ ...rivatename-no-initializer-with-method.case | 30 +++++ .../grammar-privatenames-multi-line.case | 30 +++++ .../grammar-privatenames-same-line-error.case | 31 +++++ .../rs-field-identifier-initializer.case | 66 +++++++++++ src/class-fields/rs-field-identifier.case | 73 ++++++++++++ .../rs-privatename-identifier-alt.case | 90 +++++++++++++++ ...rivatename-identifier-initializer-alt.case | 84 ++++++++++++++ ...rs-privatename-identifier-initializer.case | 84 ++++++++++++++ .../rs-privatename-identifier.case | 90 +++++++++++++++ ...tic-method-privatename-identifier-alt.case | 109 ++++++++++++++++++ ...-static-method-privatename-identifier.case | 103 +++++++++++++++++ .../rs-static-privatename-identifier-alt.case | 91 +++++++++++++++ ...rivatename-identifier-initializer-alt.case | 85 ++++++++++++++ ...ic-privatename-identifier-initializer.case | 85 ++++++++++++++ .../rs-static-privatename-identifier.case | 91 +++++++++++++++ .../cls-decl-fields-invalid-syntax.template | 18 +++ .../cls-expr-fields-invalid-syntax.template | 18 +++ .../cls-decl-fields-valid-syntax.template | 13 +++ .../cls-expr-fields-valid-syntax.template | 13 +++ 37 files changed, 2230 insertions(+) create mode 100644 src/class-fields/grammar-field-classelementname-initializer-alt.case create mode 100644 src/class-fields/grammar-field-classelementname-initializer.case create mode 100644 src/class-fields/grammar-field-def-has-initializer-no-sc-error.case create mode 100644 src/class-fields/grammar-field-identifier-alt.case create mode 100644 src/class-fields/grammar-field-identifier-invalid-ues-error.case create mode 100644 src/class-fields/grammar-field-identifier-invalid-zwj-error.case create mode 100644 src/class-fields/grammar-field-identifier-invalid-zwnj-error.case create mode 100644 src/class-fields/grammar-field-identifier.case create mode 100644 src/class-fields/grammar-fields-multi-line.case create mode 100644 src/class-fields/grammar-fields-same-line-error.case create mode 100644 src/class-fields/grammar-privatename-classelementname-initializer-alt.case create mode 100644 src/class-fields/grammar-privatename-classelementname-initializer.case create mode 100644 src/class-fields/grammar-privatename-error.case create mode 100644 src/class-fields/grammar-privatename-identifier-invalid-ues.case create mode 100644 src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case create mode 100644 src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case create mode 100644 src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case create mode 100644 src/class-fields/grammar-privatename-identifier.case create mode 100644 src/class-fields/grammar-privatename-no-initializer-with-method.case create mode 100644 src/class-fields/grammar-privatenames-multi-line.case create mode 100644 src/class-fields/grammar-privatenames-same-line-error.case create mode 100644 src/class-fields/rs-field-identifier-initializer.case create mode 100644 src/class-fields/rs-field-identifier.case create mode 100644 src/class-fields/rs-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-privatename-identifier-initializer-alt.case create mode 100644 src/class-fields/rs-privatename-identifier-initializer.case create mode 100644 src/class-fields/rs-privatename-identifier.case create mode 100644 src/class-fields/rs-static-method-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-static-method-privatename-identifier.case create mode 100644 src/class-fields/rs-static-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-static-privatename-identifier-initializer-alt.case create mode 100644 src/class-fields/rs-static-privatename-identifier-initializer.case create mode 100644 src/class-fields/rs-static-privatename-identifier.case create mode 100644 src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template create mode 100644 src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template create mode 100644 src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template create mode 100644 src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template diff --git a/src/class-fields/grammar-field-classelementname-initializer-alt.case b/src/class-fields/grammar-field-classelementname-initializer-alt.case new file mode 100644 index 0000000000..b132aa0dff --- /dev/null +++ b/src/class-fields/grammar-field-classelementname-initializer-alt.case @@ -0,0 +1,68 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-public] +---*/ + +//- fields +$ = 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 diff --git a/src/class-fields/grammar-field-classelementname-initializer.case b/src/class-fields/grammar-field-classelementname-initializer.case new file mode 100644 index 0000000000..bdfe127a64 --- /dev/null +++ b/src/class-fields/grammar-field-classelementname-initializer.case @@ -0,0 +1,68 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-public] +---*/ + +//- fields +$ = 1; +_ = 2; +\u{6F} = 3; +\u2118 = 4; +ZW_\u200C_NJ = 5; +ZW_\u200D_J = 6; diff --git a/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case b/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case new file mode 100644 index 0000000000..7c117a00af --- /dev/null +++ b/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case @@ -0,0 +1,27 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +template: syntax/invalid +features: [class-fields-private] +---*/ + +//- fields +x = [] +y; diff --git a/src/class-fields/grammar-field-identifier-alt.case b/src/class-fields/grammar-field-identifier-alt.case new file mode 100644 index 0000000000..4721b105b5 --- /dev/null +++ b/src/class-fields/grammar-field-identifier-alt.case @@ -0,0 +1,68 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid FieldDefinition, ClassElementName, PropertyName Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-public] +---*/ + +//- fields +$; +_; +\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 diff --git a/src/class-fields/grammar-field-identifier-invalid-ues-error.case b/src/class-fields/grammar-field-identifier-invalid-ues-error.case new file mode 100644 index 0000000000..e151beefe1 --- /dev/null +++ b/src/class-fields/grammar-field-identifier-invalid-ues-error.case @@ -0,0 +1,63 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-public] +---*/ + +//- fields +\u0000; diff --git a/src/class-fields/grammar-field-identifier-invalid-zwj-error.case b/src/class-fields/grammar-field-identifier-invalid-zwj-error.case new file mode 100644 index 0000000000..4c7798b6d3 --- /dev/null +++ b/src/class-fields/grammar-field-identifier-invalid-zwj-error.case @@ -0,0 +1,63 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-public] +---*/ + +//- fields +\u200D_ZWJ; diff --git a/src/class-fields/grammar-field-identifier-invalid-zwnj-error.case b/src/class-fields/grammar-field-identifier-invalid-zwnj-error.case new file mode 100644 index 0000000000..3aea99515c --- /dev/null +++ b/src/class-fields/grammar-field-identifier-invalid-zwnj-error.case @@ -0,0 +1,63 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Invalid FieldDefinition, ClassElementName, PropertyName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-public] +---*/ + +//- fields +\u200C_ZWNJ; diff --git a/src/class-fields/grammar-field-identifier.case b/src/class-fields/grammar-field-identifier.case new file mode 100644 index 0000000000..f064256c67 --- /dev/null +++ b/src/class-fields/grammar-field-identifier.case @@ -0,0 +1,68 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid FieldDefinition, ClassElementName, PropertyName Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-public] +---*/ + +//- fields +$; +_; +\u{6F}; +\u2118; +ZW_\u200C_NJ; +ZW_\u200D_J; diff --git a/src/class-fields/grammar-fields-multi-line.case b/src/class-fields/grammar-fields-multi-line.case new file mode 100644 index 0000000000..c8754e499c --- /dev/null +++ b/src/class-fields/grammar-fields-multi-line.case @@ -0,0 +1,27 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid multi-line, multi-field +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +template: syntax/valid +features: [class-fields-public] +---*/ + +//- fields +x +y diff --git a/src/class-fields/grammar-fields-same-line-error.case b/src/class-fields/grammar-fields-same-line-error.case new file mode 100644 index 0000000000..5646019930 --- /dev/null +++ b/src/class-fields/grammar-fields-same-line-error.case @@ -0,0 +1,26 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +template: syntax/invalid +features: [class-fields-public] +---*/ + +//- fields +x y diff --git a/src/class-fields/grammar-privatename-classelementname-initializer-alt.case b/src/class-fields/grammar-privatename-classelementname-initializer-alt.case new file mode 100644 index 0000000000..12a9fd8b39 --- /dev/null +++ b/src/class-fields/grammar-privatename-classelementname-initializer-alt.case @@ -0,0 +1,65 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName = Initializer Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-private] +---*/ + +//- fields +#$ = 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 diff --git a/src/class-fields/grammar-privatename-classelementname-initializer.case b/src/class-fields/grammar-privatename-classelementname-initializer.case new file mode 100644 index 0000000000..9f2c48eb4a --- /dev/null +++ b/src/class-fields/grammar-privatename-classelementname-initializer.case @@ -0,0 +1,65 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName = Initializer Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-private] +---*/ + +//- fields +#$ = 1; +#_ = 2; +#\u{6F} = 3; +#\u2118 = 4; +#ZW_\u200C_NJ = 5; +#ZW_\u200D_J = 6; diff --git a/src/class-fields/grammar-privatename-error.case b/src/class-fields/grammar-privatename-error.case new file mode 100644 index 0000000000..7561ed5d8a --- /dev/null +++ b/src/class-fields/grammar-privatename-error.case @@ -0,0 +1,29 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: No space allowed between sigial and IdentifierName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +template: syntax/invalid +features: [class-fields-private] +---*/ + +//- fields +# x diff --git a/src/class-fields/grammar-privatename-identifier-invalid-ues.case b/src/class-fields/grammar-privatename-identifier-invalid-ues.case new file mode 100644 index 0000000000..568eafc138 --- /dev/null +++ b/src/class-fields/grammar-privatename-identifier-invalid-ues.case @@ -0,0 +1,57 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-private] +---*/ + +//- fields +#\u0000; diff --git a/src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case b/src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case new file mode 100644 index 0000000000..8be2fac24f --- /dev/null +++ b/src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case @@ -0,0 +1,58 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-private] +---*/ + +//- fields +#\u200D_ZWJ; + diff --git a/src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case b/src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case new file mode 100644 index 0000000000..3764c945e9 --- /dev/null +++ b/src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case @@ -0,0 +1,58 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName Syntax +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 + + + 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". + +template: syntax/invalid +features: [class-fields-private] +---*/ + +//- fields +#\u200C_ZWNJ; + diff --git a/src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case b/src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case new file mode 100644 index 0000000000..849c52be3c --- /dev/null +++ b/src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case @@ -0,0 +1,91 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: PrivateName Static Semantics, StringValue +esid: sec-private-names-static-semantics-stringvalue +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +template: productions +features: [class-fields-private] +---*/ + +//- fields +#\u{6F}; +#\u2118; +#ZW_\u200C_NJ; +#ZW_\u200D_J; +//- privateinspectionfunctions +o(value) { + this.#o = value; + return this.#o; +} +℘(value) { + this.#℘ = value; + return this.#℘; +} +ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; +} +ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; +} +//- assertions +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/src/class-fields/grammar-privatename-identifier.case b/src/class-fields/grammar-privatename-identifier.case new file mode 100644 index 0000000000..43e817d4cb --- /dev/null +++ b/src/class-fields/grammar-privatename-identifier.case @@ -0,0 +1,62 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName Syntax +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 + + + 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". + +template: syntax/valid +features: [class-fields-private] +---*/ + +//- fields +#$; +#_; +#\u{6F}; +#\u2118; +#ZW_\u200C_NJ; +#ZW_\u200D_J; diff --git a/src/class-fields/grammar-privatename-no-initializer-with-method.case b/src/class-fields/grammar-privatename-no-initializer-with-method.case new file mode 100644 index 0000000000..8acac18273 --- /dev/null +++ b/src/class-fields/grammar-privatename-no-initializer-with-method.case @@ -0,0 +1,30 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +template: syntax/valid +features: [class-fields-private] +---*/ + +//- fields +#x +m() {} diff --git a/src/class-fields/grammar-privatenames-multi-line.case b/src/class-fields/grammar-privatenames-multi-line.case new file mode 100644 index 0000000000..727746c59a --- /dev/null +++ b/src/class-fields/grammar-privatenames-multi-line.case @@ -0,0 +1,30 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +template: syntax/valid +features: [class-fields-private] +---*/ + +//- fields +#x +#y diff --git a/src/class-fields/grammar-privatenames-same-line-error.case b/src/class-fields/grammar-privatenames-same-line-error.case new file mode 100644 index 0000000000..2a1fbb9036 --- /dev/null +++ b/src/class-fields/grammar-privatenames-same-line-error.case @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: SyntaxError +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + +template: syntax/invalid +negative: + +features: [class-fields-private] +---*/ + +//- fields +#x #y diff --git a/src/class-fields/rs-field-identifier-initializer.case b/src/class-fields/rs-field-identifier-initializer.case new file mode 100644 index 0000000000..c88435d355 --- /dev/null +++ b/src/class-fields/rs-field-identifier-initializer.case @@ -0,0 +1,66 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid FieldDefinition +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +$ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 +//- assertions +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/src/class-fields/rs-field-identifier.case b/src/class-fields/rs-field-identifier.case new file mode 100644 index 0000000000..fea8fa0b3c --- /dev/null +++ b/src/class-fields/rs-field-identifier.case @@ -0,0 +1,73 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid FieldDefinition +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +$; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J +//- assertions +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/src/class-fields/rs-privatename-identifier-alt.case b/src/class-fields/rs-privatename-identifier-alt.case new file mode 100644 index 0000000000..94ec8e31df --- /dev/null +++ b/src/class-fields/rs-privatename-identifier-alt.case @@ -0,0 +1,90 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName +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 + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +#$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J +//- privateinspectionfunctions +$(value) { + this.#$ = value; + return this.#$; +} +_(value) { + this.#_ = value; + return this.#_; +} +\u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; +} +℘(value) { + this.#℘ = value; + return this.#℘; +} +ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; +} +ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; +} +//- assertions +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/src/class-fields/rs-privatename-identifier-initializer-alt.case b/src/class-fields/rs-privatename-identifier-initializer-alt.case new file mode 100644 index 0000000000..81e6a0daf6 --- /dev/null +++ b/src/class-fields/rs-privatename-identifier-initializer-alt.case @@ -0,0 +1,84 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName +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 + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +#$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 +//- privateinspectionfunctions +$() { + return this.#$; +} +_() { + return this.#_; +} +\u{6F}() { + return this.#\u{6F}; +} +℘() { + return this.#℘; +} +ZW_‌_NJ() { + return this.#ZW_‌_NJ; +} +ZW_‍_J() { + return this.#ZW_‍_J; +} +//- assertions +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/src/class-fields/rs-privatename-identifier-initializer.case b/src/class-fields/rs-privatename-identifier-initializer.case new file mode 100644 index 0000000000..0c01d8a4f9 --- /dev/null +++ b/src/class-fields/rs-privatename-identifier-initializer.case @@ -0,0 +1,84 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName +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 + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +#$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 +//- privateinspectionfunctions +$() { + return this.#$; +} +_() { + return this.#_; +} +\u{6F}() { + return this.#\u{6F}; +} +\u2118() { + return this.#\u2118; +} +ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; +} +ZW_\u200D_J() { + return this.#ZW_\u200D_J; +} +//- assertions +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/src/class-fields/rs-privatename-identifier.case b/src/class-fields/rs-privatename-identifier.case new file mode 100644 index 0000000000..587e01aebb --- /dev/null +++ b/src/class-fields/rs-privatename-identifier.case @@ -0,0 +1,90 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid PrivateName +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 + + + 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". + +template: productions +features: [class-fields-private] +---*/ + +//- fields +#$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J +//- privateinspectionfunctions +$(value) { + this.#$ = value; + return this.#$; +} +_(value) { + this.#_ = value; + return this.#_; +} +\u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; +} +\u2118(value) { + this.#\u2118 = value; + return this.#\u2118; +} +ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; +} +ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; +} +//- assertions +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/src/class-fields/rs-static-method-privatename-identifier-alt.case b/src/class-fields/rs-static-method-privatename-identifier-alt.case new file mode 100644 index 0000000000..fbcaeaad86 --- /dev/null +++ b/src/class-fields/rs-static-method-privatename-identifier-alt.case @@ -0,0 +1,109 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static Method PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$(value) { + this.$ = value; + return value; +} +static #_(value) { + this.#stored = value; + return value; +} +static #o(value) { + this.#stored = value; + return value; +} +static #℘(value) { + this.#stored = value; + return value; +} +static #ZW_‌_NJ(value) { + this.#stored = value; + return value; +} +static #ZW_‍_J(value) { + this.#stored = value; + return value; +} +//- privateinspectionfunctions +static $(value) { + return this.#$(value); +} +static _(value) { + return this.#_(value); +} +static o(value) { + return this.#o(value); +} +static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); +} +static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); +} +static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); +} + +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/src/class-fields/rs-static-method-privatename-identifier.case b/src/class-fields/rs-static-method-privatename-identifier.case new file mode 100644 index 0000000000..b8ed91e565 --- /dev/null +++ b/src/class-fields/rs-static-method-privatename-identifier.case @@ -0,0 +1,103 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static Method PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$(value) { + return value; +} +static #_(value) { + return value; +} +static #\u{6F}(value) { + return value; +} +static #\u2118(value) { + return value; +} +static #ZW_\u200C_NJ(value) { + return value; +} +static #ZW_\u200D_J(value) { + return value; +} +//- privateinspectionfunctions +static $(value) { + return this.#$(value); +} +static _(value) { + return this.#_(value); +} +static \u{6F}(value) { + return this.#\u{6F}(value); +} +static \u2118(value) { + return this.#\u2118(value); +} +static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); +} +static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); +} + +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/src/class-fields/rs-static-privatename-identifier-alt.case b/src/class-fields/rs-static-privatename-identifier-alt.case new file mode 100644 index 0000000000..8e9afc857b --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-alt.case @@ -0,0 +1,91 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J +//- privateinspectionfunctions +static $(value) { + this.#$ = value; + return this.#$; +} +static _(value) { + this.#_ = value; + return this.#_; +} +static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; +} +static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; +} +static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; +} +static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; +} +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/src/class-fields/rs-static-privatename-identifier-initializer-alt.case b/src/class-fields/rs-static-privatename-identifier-initializer-alt.case new file mode 100644 index 0000000000..b7d7edf3e4 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-initializer-alt.case @@ -0,0 +1,85 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 +//- privateinspectionfunctions +static $() { + return this.#$; +} +static _() { + return this.#_; +} +static \u{6F}() { + return this.#\u{6F}; +} +static ℘() { + return this.#℘; +} +static ZW_‌_NJ() { + return this.#ZW_‌_NJ; +} +static ZW_‍_J() { + return this.#ZW_‍_J; +} +//- assertions +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/src/class-fields/rs-static-privatename-identifier-initializer.case b/src/class-fields/rs-static-privatename-identifier-initializer.case new file mode 100644 index 0000000000..ccc3a25590 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-initializer.case @@ -0,0 +1,85 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 +//- privateinspectionfunctions +static $() { + return this.#$; +} +static _() { + return this.#_; +} +static \u{6F}() { + return this.#\u{6F}; +} +static \u2118() { + return this.#\u2118; +} +static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; +} +static ZW_\u200D_J() { + return this.#ZW_\u200D_J; +} +//- assertions +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/src/class-fields/rs-static-privatename-identifier.case b/src/class-fields/rs-static-privatename-identifier.case new file mode 100644 index 0000000000..f3dd362b72 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier.case @@ -0,0 +1,91 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J +//- privateinspectionfunctions +static $(value) { + this.#$ = value; + return this.#$; +} +static _(value) { + this.#_ = value; + return this.#_; +} +static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; +} +static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; +} +static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; +} +static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; +} +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template b/src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template new file mode 100644 index 0000000000..3a3edf7981 --- /dev/null +++ b/src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template @@ -0,0 +1,18 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-ClassElement +name: class declaration +path: language/statements/class/syntax-invalid- +features: [class] +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + /*{ fields }*/ +} diff --git a/src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template b/src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template new file mode 100644 index 0000000000..06e279519d --- /dev/null +++ b/src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template @@ -0,0 +1,18 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-ClassElement +name: class expression +path: language/expressions/class/syntax-invalid- +features: [class] +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +var C = class { + /*{ fields }*/ +}; diff --git a/src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template b/src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template new file mode 100644 index 0000000000..c59480a8c5 --- /dev/null +++ b/src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template @@ -0,0 +1,13 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-ClassElement +name: class declaration +path: language/statements/class/syntax-valid- +features: [class] +---*/ + +class C { + /*{ fields }*/ +} diff --git a/src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template b/src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template new file mode 100644 index 0000000000..c74bde6f94 --- /dev/null +++ b/src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template @@ -0,0 +1,13 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-ClassElement +name: class expression +path: language/expressions/class/syntax-valid- +features: [class] +---*/ + +var C = class { + /*{ fields }*/ +}; From aee9dc163e494f56684f3f2ba7381b7be1fa659e Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Mon, 6 Aug 2018 13:59:20 -0400 Subject: [PATCH 22/40] Generate tests --- ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...after-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...er-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...ne-static-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...tic-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...static-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...tic-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ame-line-static-gen-rs-field-identifier.js | 90 ++++++++++ ...tatic-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...ne-static-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ic-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...-line-static-method-rs-field-identifier.js | 90 ++++++++++ ...ic-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...static-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 141 +++++++++++++++ ...nitions-rs-field-identifier-initializer.js | 119 +++++++++++++ ...ultiple-definitions-rs-field-identifier.js | 126 ++++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 141 +++++++++++++++ ...-privatename-identifier-initializer-alt.js | 135 +++++++++++++++ ...s-rs-privatename-identifier-initializer.js | 135 +++++++++++++++ ...e-definitions-rs-privatename-identifier.js | 141 +++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 160 ++++++++++++++++++ ...rs-static-method-privatename-identifier.js | 154 +++++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 142 ++++++++++++++++ ...-privatename-identifier-initializer-alt.js | 136 +++++++++++++++ ...atic-privatename-identifier-initializer.js | 136 +++++++++++++++ ...itions-rs-static-privatename-identifier.js | 142 ++++++++++++++++ ...tename-identifier-semantics-stringvalue.js | 119 +++++++++++++ ...nitions-rs-field-identifier-initializer.js | 97 +++++++++++ ...stacked-definitions-rs-field-identifier.js | 104 ++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 119 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 113 +++++++++++++ ...s-rs-privatename-identifier-initializer.js | 113 +++++++++++++ ...d-definitions-rs-privatename-identifier.js | 119 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 138 +++++++++++++++ ...rs-static-method-privatename-identifier.js | 132 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 120 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 114 +++++++++++++ ...atic-privatename-identifier-initializer.js | 114 +++++++++++++ ...itions-rs-static-privatename-identifier.js | 120 +++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...w-no-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 84 +++++++++ ...lds-new-sc-line-gen-rs-field-identifier.js | 91 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...w-sc-line-gen-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...-new-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 94 ++++++++++ ...nitions-rs-field-identifier-initializer.js | 72 ++++++++ ...regular-definitions-rs-field-identifier.js | 79 +++++++++ ...finitions-rs-privatename-identifier-alt.js | 94 ++++++++++ ...-privatename-identifier-initializer-alt.js | 88 ++++++++++ ...s-rs-privatename-identifier-initializer.js | 88 ++++++++++ ...r-definitions-rs-privatename-identifier.js | 94 ++++++++++ ...tatic-method-privatename-identifier-alt.js | 113 +++++++++++++ ...rs-static-method-privatename-identifier.js | 107 ++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 95 +++++++++++ ...-privatename-identifier-initializer-alt.js | 89 ++++++++++ ...atic-privatename-identifier-initializer.js | 89 ++++++++++ ...itions-rs-static-privatename-identifier.js | 95 +++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...same-line-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...ine-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...e-line-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ields-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...ds-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 96 +++++++++++ ...d-in-sc-rs-field-identifier-initializer.js | 74 ++++++++ ...ields-wrapped-in-sc-rs-field-identifier.js | 81 +++++++++ ...ped-in-sc-rs-privatename-identifier-alt.js | 96 +++++++++++ ...-privatename-identifier-initializer-alt.js | 90 ++++++++++ ...c-rs-privatename-identifier-initializer.js | 90 ++++++++++ ...wrapped-in-sc-rs-privatename-identifier.js | 96 +++++++++++ ...tatic-method-privatename-identifier-alt.js | 115 +++++++++++++ ...rs-static-method-privatename-identifier.js | 109 ++++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 97 +++++++++++ ...-privatename-identifier-initializer-alt.js | 91 ++++++++++ ...atic-privatename-identifier-initializer.js | 91 ++++++++++ ...-in-sc-rs-static-privatename-identifier.js | 97 +++++++++++ ...grammar-field-def-has-initializer-no-sc.js | 31 ++++ ...rammar-field-no-initializer-with-method.js | 32 ++++ .../class/syntax-error-grammar-fields.js | 31 ++++ ...-privatename-no-initializer-with-method.js | 35 ++++ .../class/syntax-error-grammar-privatename.js | 34 ++++ .../syntax-error-grammar-privatenames.js | 34 ++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ++++ ...mmar-field-identifier-invalid-ues-error.js | 71 ++++++++ ...mmar-field-identifier-invalid-zwj-error.js | 71 ++++++++ ...mar-field-identifier-invalid-zwnj-error.js | 71 ++++++++ ...-invalid-grammar-fields-same-line-error.js | 34 ++++ ...yntax-invalid-grammar-privatename-error.js | 37 ++++ ...mmar-privatename-identifier-invalid-ues.js | 65 +++++++ ...rivatename-identifier-invalid-zwj-error.js | 66 ++++++++ ...ivatename-identifier-invalid-zwnj-error.js | 66 ++++++++ ...ivatename-identifier-non-id-start-error.js | 65 +++++++ ...ar-privatename-identifier-non-ues-error.js | 65 +++++++ ...id-grammar-privatenames-same-line-error.js | 37 ++++ ...-field-classelementname-initializer-alt.js | 71 ++++++++ ...mmar-field-classelementname-initializer.js | 71 ++++++++ ...ntax-valid-grammar-field-identifier-alt.js | 71 ++++++++ .../syntax-valid-grammar-field-identifier.js | 71 ++++++++ .../syntax-valid-grammar-fields-multi-line.js | 30 ++++ ...tename-classelementname-initializer-alt.js | 68 ++++++++ ...rivatename-classelementname-initializer.js | 68 ++++++++ ...ax-valid-grammar-privatename-identifier.js | 65 +++++++ ...-privatename-no-initializer-with-method.js | 33 ++++ ...x-valid-grammar-privatenames-multi-line.js | 33 ++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...after-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...er-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...ne-static-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...tic-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...static-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...tic-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ame-line-static-gen-rs-field-identifier.js | 90 ++++++++++ ...tatic-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...ne-static-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ic-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...-line-static-method-rs-field-identifier.js | 90 ++++++++++ ...ic-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...static-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 141 +++++++++++++++ ...nitions-rs-field-identifier-initializer.js | 119 +++++++++++++ ...ultiple-definitions-rs-field-identifier.js | 126 ++++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 141 +++++++++++++++ ...-privatename-identifier-initializer-alt.js | 135 +++++++++++++++ ...s-rs-privatename-identifier-initializer.js | 135 +++++++++++++++ ...e-definitions-rs-privatename-identifier.js | 141 +++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 160 ++++++++++++++++++ ...rs-static-method-privatename-identifier.js | 154 +++++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 142 ++++++++++++++++ ...-privatename-identifier-initializer-alt.js | 136 +++++++++++++++ ...atic-privatename-identifier-initializer.js | 136 +++++++++++++++ ...itions-rs-static-privatename-identifier.js | 142 ++++++++++++++++ ...tename-identifier-semantics-stringvalue.js | 119 +++++++++++++ ...nitions-rs-field-identifier-initializer.js | 97 +++++++++++ ...stacked-definitions-rs-field-identifier.js | 104 ++++++++++++ ...finitions-rs-privatename-identifier-alt.js | 119 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 113 +++++++++++++ ...s-rs-privatename-identifier-initializer.js | 113 +++++++++++++ ...d-definitions-rs-privatename-identifier.js | 119 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 138 +++++++++++++++ ...rs-static-method-privatename-identifier.js | 132 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 120 +++++++++++++ ...-privatename-identifier-initializer-alt.js | 114 +++++++++++++ ...atic-privatename-identifier-initializer.js | 114 +++++++++++++ ...itions-rs-static-privatename-identifier.js | 120 +++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...w-no-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 84 +++++++++ ...lds-new-sc-line-gen-rs-field-identifier.js | 91 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...w-sc-line-gen-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 106 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 84 +++++++++ ...-new-sc-line-method-rs-field-identifier.js | 91 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 100 +++++++++++ ...c-line-method-rs-privatename-identifier.js | 106 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 125 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 119 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 107 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 101 +++++++++++ ...atic-privatename-identifier-initializer.js | 101 +++++++++++ ...method-rs-static-privatename-identifier.js | 107 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 94 ++++++++++ ...nitions-rs-field-identifier-initializer.js | 72 ++++++++ ...regular-definitions-rs-field-identifier.js | 79 +++++++++ ...finitions-rs-privatename-identifier-alt.js | 94 ++++++++++ ...-privatename-identifier-initializer-alt.js | 88 ++++++++++ ...s-rs-privatename-identifier-initializer.js | 88 ++++++++++ ...r-definitions-rs-privatename-identifier.js | 94 ++++++++++ ...tatic-method-privatename-identifier-alt.js | 113 +++++++++++++ ...rs-static-method-privatename-identifier.js | 107 ++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 95 +++++++++++ ...-privatename-identifier-initializer-alt.js | 89 ++++++++++ ...atic-privatename-identifier-initializer.js | 89 ++++++++++ ...itions-rs-static-privatename-identifier.js | 95 +++++++++++ ...tename-identifier-semantics-stringvalue.js | 109 ++++++++++++ ...ync-gen-rs-field-identifier-initializer.js | 87 ++++++++++ ...same-line-async-gen-rs-field-identifier.js | 94 ++++++++++ ...async-gen-rs-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 103 +++++++++++ ...ine-async-gen-rs-privatename-identifier.js | 109 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 128 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 122 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 110 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 104 ++++++++++++ ...atic-privatename-identifier-initializer.js | 104 ++++++++++++ ...nc-gen-rs-static-privatename-identifier.js | 110 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 108 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 86 ++++++++++ ...e-line-async-method-rs-field-identifier.js | 93 ++++++++++ ...nc-method-rs-privatename-identifier-alt.js | 108 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 102 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 102 +++++++++++ ...-async-method-rs-privatename-identifier.js | 108 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 127 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 121 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 109 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 103 +++++++++++ ...atic-privatename-identifier-initializer.js | 103 +++++++++++ ...method-rs-static-privatename-identifier.js | 109 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...ine-gen-rs-field-identifier-initializer.js | 83 +++++++++ ...ields-same-line-gen-rs-field-identifier.js | 90 ++++++++++ ...-line-gen-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...n-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...same-line-gen-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...ne-gen-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 105 ++++++++++++ ...-method-rs-field-identifier-initializer.js | 83 +++++++++ ...ds-same-line-method-rs-field-identifier.js | 90 ++++++++++ ...ne-method-rs-privatename-identifier-alt.js | 105 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 99 +++++++++++ ...d-rs-privatename-identifier-initializer.js | 99 +++++++++++ ...e-line-method-rs-privatename-identifier.js | 105 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 124 ++++++++++++++ ...rs-static-method-privatename-identifier.js | 118 +++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 106 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 100 +++++++++++ ...atic-privatename-identifier-initializer.js | 100 +++++++++++ ...method-rs-static-privatename-identifier.js | 106 ++++++++++++ ...tename-identifier-semantics-stringvalue.js | 96 +++++++++++ ...d-in-sc-rs-field-identifier-initializer.js | 74 ++++++++ ...ields-wrapped-in-sc-rs-field-identifier.js | 81 +++++++++ ...ped-in-sc-rs-privatename-identifier-alt.js | 96 +++++++++++ ...-privatename-identifier-initializer-alt.js | 90 ++++++++++ ...c-rs-privatename-identifier-initializer.js | 90 ++++++++++ ...wrapped-in-sc-rs-privatename-identifier.js | 96 +++++++++++ ...tatic-method-privatename-identifier-alt.js | 115 +++++++++++++ ...rs-static-method-privatename-identifier.js | 109 ++++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 97 +++++++++++ ...-privatename-identifier-initializer-alt.js | 91 ++++++++++ ...atic-privatename-identifier-initializer.js | 91 ++++++++++ ...-in-sc-rs-static-privatename-identifier.js | 97 +++++++++++ ...grammar-field-def-has-initializer-no-sc.js | 31 ++++ ...rammar-field-no-initializer-with-method.js | 32 ++++ .../class/syntax-error-grammar-fields.js | 31 ++++ ...-privatename-no-initializer-with-method.js | 35 ++++ .../class/syntax-error-grammar-privatename.js | 34 ++++ .../syntax-error-grammar-privatenames.js | 34 ++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ++++ ...mmar-field-identifier-invalid-ues-error.js | 71 ++++++++ ...mmar-field-identifier-invalid-zwj-error.js | 71 ++++++++ ...mar-field-identifier-invalid-zwnj-error.js | 71 ++++++++ ...-invalid-grammar-fields-same-line-error.js | 34 ++++ ...yntax-invalid-grammar-privatename-error.js | 37 ++++ ...mmar-privatename-identifier-invalid-ues.js | 65 +++++++ ...rivatename-identifier-invalid-zwj-error.js | 66 ++++++++ ...ivatename-identifier-invalid-zwnj-error.js | 66 ++++++++ ...ivatename-identifier-non-id-start-error.js | 65 +++++++ ...ar-privatename-identifier-non-ues-error.js | 65 +++++++ ...id-grammar-privatenames-same-line-error.js | 37 ++++ ...-field-classelementname-initializer-alt.js | 71 ++++++++ ...mmar-field-classelementname-initializer.js | 71 ++++++++ ...ntax-valid-grammar-field-identifier-alt.js | 71 ++++++++ .../syntax-valid-grammar-field-identifier.js | 71 ++++++++ .../syntax-valid-grammar-fields-multi-line.js | 30 ++++ ...tename-classelementname-initializer-alt.js | 68 ++++++++ ...rivatename-classelementname-initializer.js | 68 ++++++++ ...ax-valid-grammar-privatename-identifier.js | 65 +++++++ ...-privatename-no-initializer-with-method.js | 33 ++++ ...x-valid-grammar-privatenames-multi-line.js | 33 ++++ 498 files changed, 49704 insertions(+) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js create mode 100644 test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js create mode 100644 test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-error-grammar-fields.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatename.js create mode 100644 test/language/expressions/class/syntax-error-grammar-privatenames.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js create mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-field-identifier.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js create mode 100644 test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js create mode 100644 test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-error-grammar-fields.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatename.js create mode 100644 test/language/statements/class/syntax-error-grammar-privatenames.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js create mode 100644 test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-field-identifier.js create mode 100644 test/language/statements/class/syntax-valid-grammar-fields-multi-line.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-identifier.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js create mode 100644 test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..abc30af89f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..4c9cb38386 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..f4cd4bdd9e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..a75596b0d0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..17896a22bd --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c0ee0b4924 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..fafb30e5ea --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..e3c927ecaa --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f583254b5b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..46d1a107a4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..cb66f59c8a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..9cf2145b03 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..18aa8bd979 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..7dec72eaa0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0a0fdebfdc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..89cd17b992 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b5ea3953f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..8c11ae4160 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ee9058804f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..b8985cd3b4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a450a689d0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..5b00501645 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..57b8d679a3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..398218314b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ca2286d78f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..172bc77851 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3fac03c1e5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..ebdad02016 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..5d6cc1dede --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..9bceb8ad1f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..43143675db --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..8e3a001a3d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..c8e9e4a152 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c3adc2883a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..2e339ebfe3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..cefca0895d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..cf52bf9422 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..650296ac2b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..6f82a68b6a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..a124cb4b34 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6ab83cfbd0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..1913470f62 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..c319e0f2e9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..27b99bc832 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b8e4f8304e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..ce08f25507 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3393a2553d --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..946645e069 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..413a1fc6f0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dd25aee729 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..5f13258900 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a40dcffc39 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..a3985c5b61 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..1af61bd812 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js new file mode 100644 index 0000000000..3c8431712e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..ce0b449d92 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0ce52d94e5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..3134c68851 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..af70e7e929 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f282f026aa --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..b82b9c0105 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..f28b29fb0a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dbc6e893cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d8849231f6 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..0e240f1e59 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..c9d3d3aa49 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + static m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6a2095badb --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js new file mode 100644 index 0000000000..136b3c42f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..79caa36ce4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c94c0151ad --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d22e890101 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..60c062b25b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4190a189f9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..0195586210 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b2e00cc339 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..69b632cd70 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2e22625d06 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..1dded9c225 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..0712be6cc6 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m2() { return 39 } + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..632c8c119b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..93f5643f5a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js @@ -0,0 +1,126 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7052d732da --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..739ce1027a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..dcb8bd0091 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..7f418d1f4c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8d63cb93eb --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..1cd184c5c7 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,154 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b3a0eb1889 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6839f876e9 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0c388f3982 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..644647bd0d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..f555657293 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + foo = "foobar" + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0ebd53481d --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..bbf70435d5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..602aa8cd56 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0e6bdc88f5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..803bdbe03b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..e28f81ae7b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..385f8bd798 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f2cd4be402 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..e476161bd0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ab1705896e --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b8916c68b5 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..7ece03a60f --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..d1379b96ba --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..33368c9728 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..038b2feb76 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..fa5056e237 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6a082a7b0c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..af503cae70 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..f3d0cbb698 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d6b0423dbb --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..42383a312e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..83e9e56b31 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..aa5f913d2c --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..28d9712a7e --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..be24db224f --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..ec6fa5ac28 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..c20042d7b9 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..9d90b1932c --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b3f83f12e2 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5a7ed4f9d7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..131e929802 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..303faedec2 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..34b6e8aad9 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..c35499141e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..79abd2b1d7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..56d10480f4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..8d3616dbbb --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a51d2a0a70 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..5c07c4cdb3 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..e643193c31 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..0bf202d1f4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..068dc85b68 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d041281690 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..a7b65c1618 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..3985fcc021 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d4806f6263 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e1f09a5315 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3328f4b152 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..362b98deac --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ace5e03f92 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..cc7d1938eb --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..041cfcc2e5 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..1e0e3cdde1 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..ad9c241d8f --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js @@ -0,0 +1,79 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b02fcda1cd --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c73a77c87f --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bf416c4434 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..769990cab6 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c80aa0fb19 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e6081cec13 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..2f02754482 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..48835e88a7 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bc7881bbd3 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..7d220b583c --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..beb3cc2488 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..bbdfedbb51 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..beecac0890 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7735511177 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..637644f0e4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..87052a49a2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..087e6b602c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..5863e85032 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..3f4c9d669c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..56c4ad6330 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..7a69dae3c6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..98f953fefc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..eb6574f69c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..47e9e32ab5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..b68f5a4f9a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..f326a177f7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2a88cedd6c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..999e3030b7 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..44c1648c12 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..a8e9636aa6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c313384155 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..68b413796a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..ee21047e7e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..29310bb8d5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6776f3be0e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..290a73d447 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3ba63e3ffc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..df763485f5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..6e13fd26d8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..3d07448b0d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a74bc215f8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..f663a4fff8 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..307ad86868 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8626d4d9ce --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e75c4c43fb --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3a46e362c5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..48dfcc5dc2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d9fd2bd514 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..95394cbfc4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..43d49b5254 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..d75572687c --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..52788e419e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..6a65f2782d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..2fcabecf4e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0204afa5e6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..b105329911 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + +---*/ + + +var C = class { + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3aad6acb36 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..7079bb7a6f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..e60739d025 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..4490b98386 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..54220041d4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..cc08c93317 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..53c726d831 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: PrivateName Static Semantics, StringValue (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +var C = class { + ;;;; + ;;;;;;#\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;;;;;;;; + ;;;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6a13112465 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;$ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js new file mode 100644 index 0000000000..77f2f760df --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;$; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J;;;;;;; + ;;;; + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b7e59d2270 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1590c6fbec --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..4e9eb7d88d --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js new file mode 100644 index 0000000000..dc07187285 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;#$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d451faabf1 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..718e57c760 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..56476171f5 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..91f24eddda --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..600d128f4b --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..96d00ea178 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js new file mode 100644 index 0000000000..fbaef4ff02 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = [] +}; diff --git a/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js new file mode 100644 index 0000000000..8d5165aeea --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x + m() {} +}; diff --git a/test/language/expressions/class/syntax-error-grammar-fields.js b/test/language/expressions/class/syntax-error-grammar-fields.js new file mode 100644 index 0000000000..6407595550 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-fields.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x y +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..fd4b1769c8 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x + m() {} +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename.js b/test/language/expressions/class/syntax-error-grammar-privatename.js new file mode 100644 index 0000000000..27af62cf40 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatename.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + # x +}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatenames.js b/test/language/expressions/class/syntax-error-grammar-privatenames.js new file mode 100644 index 0000000000..8ee4dfe277 --- /dev/null +++ b/test/language/expressions/class/syntax-error-grammar-privatenames.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x #y +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js new file mode 100644 index 0000000000..bc825b5981 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x = [] + y; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js new file mode 100644 index 0000000000..e12ecfb47f --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-ues-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..9dd80bef4e --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u200D_ZWJ; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..efed7d1a68 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + \u200C_ZWNJ; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js b/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js new file mode 100644 index 0000000000..5b3a8bf5f9 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-fields-same-line-error.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-same-line-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + x y +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js new file mode 100644 index 0000000000..9fa2055c0d --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + # x +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js new file mode 100644 index 0000000000..07c84a94b3 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-ues.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..ff96485732 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u200D_ZWJ; + +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..4e5187f254 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u200C_ZWNJ; + +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js new file mode 100644 index 0000000000..6628fbc8c5 --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u{00}; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js new file mode 100644 index 0000000000..c652458c3c --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-ues-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #\u0000; +}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js new file mode 100644 index 0000000000..3c784f2c8a --- /dev/null +++ b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-same-line-error.case +// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x #y +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js new file mode 100644 index 0000000000..2208a98776 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + $ = 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 +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js new file mode 100644 index 0000000000..9d5f47865f --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: FieldDefinition, ClassElementName, PropertyName = Initializer Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + $ = 1; + _ = 2; + \u{6F} = 3; + \u2118 = 4; + ZW_\u200C_NJ = 5; + ZW_\u200D_J = 6; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js new file mode 100644 index 0000000000..66d2ac85ca --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + $; + _; + \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 +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js new file mode 100644 index 0000000000..84e3d3babf --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + $; + _; + \u{6F}; + \u2118; + ZW_\u200C_NJ; + ZW_\u200D_J; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js new file mode 100644 index 0000000000..31c2a2636a --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js @@ -0,0 +1,30 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-multi-line.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +esid: prod-ClassElement +features: [class-fields-public, class] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + +---*/ + + +var C = class { + x + y +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js new file mode 100644 index 0000000000..402984e744 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + #$ = 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 +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js new file mode 100644 index 0000000000..2300ceb9bb --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName = Initializer Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + #$ = 1; + #_ = 2; + #\u{6F} = 3; + #\u2118 = 4; + #ZW_\u200C_NJ = 5; + #ZW_\u200D_J = 6; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js new file mode 100644 index 0000000000..3dd423e459 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: Valid PrivateName Syntax (class expression) +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 + + + 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". + +---*/ + + +var C = class { + #$; + #_; + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..59c168d547 --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +var C = class { + #x + m() {} +}; diff --git a/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js new file mode 100644 index 0000000000..12c752cead --- /dev/null +++ b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-multi-line.case +// - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template +/*--- +description: SyntaxError (class expression) +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 + +---*/ + + +var C = class { + #x + #y +}; diff --git a/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..f0d5d3d869 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..bb5b0c29cb --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..8ad3b28987 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..d3ff9843a6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..57020b3038 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..3ed96ba41e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..21c2743ab5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9d7602d88a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..10801eb81d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..77b9bc9dc6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..31184005f2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..879397ec08 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..68718363b5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..61b6da15b2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..fb52206576 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..baad9d3789 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..0df46fd173 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..0ec2d10a1a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ca70313036 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..e5a1a42578 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9307410f92 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..c8674d0806 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..5966b9f911 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1a79b9f781 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0effbde88b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..225353687c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..00a11b1b80 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..31e9d4bd02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..37a91f8367 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2e3f7e474d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..71ba207ac6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..cb27bfb4e8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..88e75b193c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1dbf9e7330 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8cc3b1eaf3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3d53db9e2b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..dc2457f1b4 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6e0bd25a22 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..e154ad948d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..af52cae65b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..9cd2102348 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..f265b554a1 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2c1614bf00 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..e77d1ee1d6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..615777f71f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..6dd90ca9d8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + static async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a90f56c3fe --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..e3ae14e8dc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..79460938b7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a3a825ad92 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bf5c8cc24f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a38f6c4d74 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..0991ff9354 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..5d3c96d910 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js new file mode 100644 index 0000000000..30d0d1e4e9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid FieldDefinition (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..30ccd4f707 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a924e0a11f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..f8a948131c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..682f1fdabc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..910ec2e31c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8df748077f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..8eba30baf7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..aa4abf04b3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2e0cbb484c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..9ee640049e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..82393b1bfe --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + static m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..24fb8b5632 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js new file mode 100644 index 0000000000..cff5a7f9c9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid FieldDefinition (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..afe1dcac02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..047f50e714 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..73abdab8c2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..d736747c32 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + static m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..35b58661cf --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..4d9376e51b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a4df060683 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..75fffcc2fd --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..222e3c3d0c --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..59fd93d265 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..e749c637b5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m2() { return 39 } + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..687a0e89b5 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..90f5beeac8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js @@ -0,0 +1,126 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid FieldDefinition (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..2ff87867ef --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..6f79a3983d --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..2d0407dcc9 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + foo = "foobar"; + m() { return 42 } + #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..83e1449291 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -0,0 +1,141 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 { + foo = "foobar"; + m() { return 42 } + #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..bcfb8748ea --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,160 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..09478b3851 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,154 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m2() { return 39 } + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..dfdd73f063 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..bca1831262 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c21ea4bfe3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..00fd6c1921 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..22fa2b0da1 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + foo = "foobar" + bar = "barbaz"; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..76c04b7d49 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..e247070e43 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid FieldDefinition (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..aa000ad656 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ab1bb85ab4 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..bae395d9ac --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..272bc0f863 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 + foo = "foobar" + bar = "barbaz"; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..ef23039467 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,138 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..93d348a85a --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + foo = "foobar" + bar = "barbaz"; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..9342cb0df3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..13c7d5b6ad --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..298fcd3813 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..216abbc8b8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..9c0ac0843a --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..360326b4af --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..119e961590 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..7d2e2a20ab --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5f3108daea --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b379b24f68 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..bd161b009e --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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 + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..def9522ced --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..bf2d74877f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..ef29d93d2f --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..5dffc941b5 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d0d2db69d9 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..002c1424d0 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..98b45a5a8f --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..467ee066d3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..e61355b381 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..b5a7337abc --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a2302883ff --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..c5841d293e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..07e31b0595 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; + *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..09243ce857 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..037f0af699 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..de4903af25 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..022c50d953 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..a0d77cef6b --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..2082647210 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..619efe11e3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..2b98490a54 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..77075206b3 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..781cc7baa0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a68c9c672b --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..0be603cf23 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..77965045d0 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; + m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..aef53585d1 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..d5b6f83f37 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a220ddb736 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..32f572cf7e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..ddfc226c3c --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..e6d17b1502 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..3b6200a167 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: PrivateName Static Semantics, StringValue (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6439266ac6 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1 + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js new file mode 100644 index 0000000000..719660f778 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js @@ -0,0 +1,79 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid FieldDefinition (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..8d063826b9 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..9e7e93dc4a --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..b943795c9e --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -0,0 +1,88 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1 + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js new file mode 100644 index 0000000000..0f123c614f --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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 + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f32831af59 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,113 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..f825b5cd62 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static Method PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..a0834c7e2c --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d53d2260f5 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..169139c146 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1 + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..9fe26d29d5 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..684c6cde62 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + async *m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..96d9b0a9cd --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -0,0 +1,87 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js new file mode 100644 index 0000000000..45fb9c76a7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js @@ -0,0 +1,94 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid FieldDefinition (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..01b1b15be3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async *m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..1d3fef8e89 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..fe793e6a42 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async *m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..01b1418205 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async *m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..95282d0a0f --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,128 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..63d11f1ee3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..6649adc942 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..38a850f4ad --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..15731e6585 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..4ee4955df7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..1ee7dd8fd3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + async m() { return 42; } #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..292a5c4b39 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -0,0 +1,86 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js new file mode 100644 index 0000000000..fd0af86be3 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js @@ -0,0 +1,93 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid FieldDefinition (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } $; _; \u{6F}; \u2118; ZW_\u200C_NJ; ZW_\u200D_J; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..88897a8a75 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW_‌_NJ; #ZW_‍_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..bc7ec4d60f --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..d695c6068d --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async m() { return 42; } #$ = 1; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..d4c78171b2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -0,0 +1,108 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +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 + + + 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 { + async m() { return 42; } #$; #_; #\u{6F}; #\u2118; #ZW_\u200C_NJ; #ZW_\u200D_J; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1e8d884956 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,127 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..4689824b50 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static Method PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..874375753a --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a6a4e362c6 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..fb5b87f15c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..723f1ab635 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..8a26a88ca0 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; *m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..730cf1ab8f --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js new file mode 100644 index 0000000000..bbb8c36526 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid FieldDefinition (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..5f6cdf2a78 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ca55902848 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..eb13a59e9a --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; *m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js new file mode 100644 index 0000000000..ebf2311b1c --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; *m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..16754b1bab --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..aef62fd988 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; *m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..3180736ccc --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..ef96d042d7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..460d9d2caf --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; *m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..a217c90f53 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..2d4adbcbf6 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: PrivateName Static Semantics, StringValue (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + #\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;; m() { return 42; } + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..6da87a0772 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js new file mode 100644 index 0000000000..532cf1574d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid FieldDefinition (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..5b8e75fe25 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..d5cab7a721 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..99a60d4a1d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -0,0 +1,99 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1; m() { return 42; } + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js new file mode 100644 index 0000000000..0476a72839 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +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 + + + 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; m() { return 42; } + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..da60f6ade0 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..2a8e5726c2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -0,0 +1,118 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static Method PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + }; m() { return 42; } + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..c50fc6c5c7 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..c840d5639d --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..5bdd621782 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1; m() { return 42; } + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..27d499712f --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js new file mode 100644 index 0000000000..b4b458afbb --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-semantics-stringvalue.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: PrivateName Static Semantics, StringValue (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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". + + + 1. Return the String value consisting of the sequence of code + units corresponding to PrivateName. In determining the sequence + any occurrences of \ UnicodeEscapeSequence are first replaced + with the code point represented by the UnicodeEscapeSequence + and then the code points of the entire PrivateName are converted + to code units by UTF16Encoding (10.1.1) each code point. + +---*/ + + +class C { + ;;;; + ;;;;;;#\u{6F}; + #\u2118; + #ZW_\u200C_NJ; + #ZW_\u200D_J;;;;;;;; + ;;;; + o(value) { + this.#o = value; + return this.#o; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS METHOD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.o(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js new file mode 100644 index 0000000000..0b36001dc4 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js new file mode 100644 index 0000000000..9ed86d6da1 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -0,0 +1,81 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-field-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid FieldDefinition (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + ... + FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + + PropertyName : + LiteralPropertyName + ComputedPropertyName + + LiteralPropertyName : + IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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;;;;;;; + ;;;; + +} + +var c = new C(); + +c.$ = 1; +c._ = 1; +c.\u{6F} = 1; +c.\u2118 = 1; +c.ZW_\u200C_NJ = 1; +c.ZW_\u200D_J = 1; + +assert.sameValue(c.$, 1); +assert.sameValue(c._, 1); +assert.sameValue(c.\u{6F}, 1); +assert.sameValue(c.\u2118, 1); +assert.sameValue(c.ZW_\u200C_NJ, 1); +assert.sameValue(c.ZW_\u200D_J, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js new file mode 100644 index 0000000000..c0d6bb22dd --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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}; #℘; #ZW_‌_NJ; #ZW_‍_J;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + ℘(value) { + this.#℘ = value; + return this.#℘; + } + ZW_‌_NJ(value) { + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + ZW_‍_J(value) { + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.℘(1), 1); +assert.sameValue(c.ZW_‌_NJ(1), 1); +assert.sameValue(c.ZW_‍_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..63f406d8f5 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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; #_ = 1; #\u{6F} = 1; #℘ = 1; #ZW_‌_NJ = 1; #ZW_‍_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + ℘() { + return this.#℘; + } + ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.℘(), 1); +assert.sameValue(c.ZW_‌_NJ(), 1); +assert.sameValue(c.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js new file mode 100644 index 0000000000..6803fd8731 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -0,0 +1,90 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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; #_ = 1; #\u{6F} = 1; #\u2118 = 1; #ZW_\u200C_NJ = 1; #ZW_\u200D_J = 1;;;;;;; + ;;;; + $() { + return this.#$; + } + _() { + return this.#_; + } + \u{6F}() { + return this.#\u{6F}; + } + \u2118() { + return this.#\u2118; + } + ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(), 1); +assert.sameValue(c._(), 1); +assert.sameValue(c.\u{6F}(), 1); +assert.sameValue(c.\u2118(), 1); +assert.sameValue(c.ZW_\u200C_NJ(), 1); +assert.sameValue(c.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js new file mode 100644 index 0000000000..d6d84e59db --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-fields-private, class, class-fields-public] +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 + + + 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;;;;;;; + ;;;; + $(value) { + this.#$ = value; + return this.#$; + } + _(value) { + this.#_ = value; + return this.#_; + } + \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.$(1), 1); +assert.sameValue(c._(1), 1); +assert.sameValue(c.\u{6F}(1), 1); +assert.sameValue(c.\u2118(1), 1); +assert.sameValue(c.ZW_\u200C_NJ(1), 1); +assert.sameValue(c.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..16561b43e5 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -0,0 +1,115 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$(value) { + this.$ = value; + return value; + } + static #_(value) { + this.#stored = value; + return value; + } + static #o(value) { + this.#stored = value; + return value; + } + static #℘(value) { + this.#stored = value; + return value; + } + static #ZW_‌_NJ(value) { + this.#stored = value; + return value; + } + static #ZW_‍_J(value) { + this.#stored = value; + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static o(value) { + return this.#o(value); + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘(value); + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ(value); + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js new file mode 100644 index 0000000000..8801041a42 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static Method PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$(value) { + return value; + } + static #_(value) { + return value; + } + static #\u{6F}(value) { + return value; + } + static #\u2118(value) { + return value; + } + static #ZW_\u200C_NJ(value) { + return value; + } + static #ZW_\u200D_J(value) { + return value; + };;;;;;; + ;;;; + static $(value) { + return this.#$(value); + } + static _(value) { + return this.#_(value); + } + static \u{6F}(value) { + return this.#\u{6F}(value); + } + static \u2118(value) { + return this.#\u2118(value); + } + static ZW_\u200C_NJ(value) { + return this.#ZW_\u200C_NJ(value); + } + static ZW_\u200D_J(value) { + return this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js new file mode 100644 index 0000000000..b17e1c0926 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static o(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#℘ = value; + return this.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‌_NJ = value; + return this.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + this.#ZW_‍_J = value; + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js new file mode 100644 index 0000000000..a680c61c5c --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static ℘() { + return this.#℘; + } + static ZW_‌_NJ() { + return this.#ZW_‌_NJ; + } + static ZW_‍_J() { + return this.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js new file mode 100644 index 0000000000..93b92daff4 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #\u2118 = 1; static #ZW_\u200C_NJ = 1; static #ZW_\u200D_J = 1;;;;;;; + ;;;; + static $() { + return this.#$; + } + static _() { + return this.#_; + } + static \u{6F}() { + return this.#\u{6F}; + } + static \u2118() { + return this.#\u2118; + } + static ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J() { + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.\u2118(), 1); +assert.sameValue(C.ZW_\u200C_NJ(), 1); +assert.sameValue(C.ZW_\u200D_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js new file mode 100644 index 0000000000..4725ed7115 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName:: + # IdentifierName + + IdentifierName:: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart:: + UnicodeIDStart + $ + _ + \UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + this.#$ = value; + return this.#$; + } + static _(value) { + this.#_ = value; + return this.#_; + } + static \u{6F}(value) { + this.#\u{6F} = value; + return this.#\u{6F}; + } + static \u2118(value) { + this.#\u2118 = value; + return this.#\u2118; + } + static ZW_\u200C_NJ(value) { + this.#ZW_\u200C_NJ = value; + return this.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + this.#ZW_\u200D_J = value; + return this.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js new file mode 100644 index 0000000000..4dfed1839e --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = [] +} diff --git a/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js new file mode 100644 index 0000000000..d4991c69f1 --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x + m() {} +} diff --git a/test/language/statements/class/syntax-error-grammar-fields.js b/test/language/statements/class/syntax-error-grammar-fields.js new file mode 100644 index 0000000000..7b0527c42f --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-fields.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: SyntaxError (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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x y +} diff --git a/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..1014356e35 --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x + m() {} +} diff --git a/test/language/statements/class/syntax-error-grammar-privatename.js b/test/language/statements/class/syntax-error-grammar-privatename.js new file mode 100644 index 0000000000..e92dadf3ac --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatename.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + # x +} diff --git a/test/language/statements/class/syntax-error-grammar-privatenames.js b/test/language/statements/class/syntax-error-grammar-privatenames.js new file mode 100644 index 0000000000..503031c6bd --- /dev/null +++ b/test/language/statements/class/syntax-error-grammar-privatenames.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x #y +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js new file mode 100644 index 0000000000..b0eb3a3a07 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x = [] + y; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js new file mode 100644 index 0000000000..f0a7779408 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-ues-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid 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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..5bc7632b4d --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid 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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u200D_ZWJ; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..638f1ca522 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template +/*--- +description: Valid 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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + \u200C_ZWNJ; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js b/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js new file mode 100644 index 0000000000..feafa0013b --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-fields-same-line-error.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-same-line-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + x y +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js new file mode 100644 index 0000000000..7ddf739086 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + # x +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js new file mode 100644 index 0000000000..95e59adab0 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-ues.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js new file mode 100644 index 0000000000..052e5c8493 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u200D_ZWJ; + +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js new file mode 100644 index 0000000000..accdca3be8 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -0,0 +1,66 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-invalid-zwnj-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u200C_ZWNJ; + +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js new file mode 100644 index 0000000000..01562653b4 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u{00}; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js new file mode 100644 index 0000000000..5dfa380f04 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier-non-ues-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + + + 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". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #\u0000; +} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js new file mode 100644 index 0000000000..c76d611923 --- /dev/null +++ b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-same-line-error.case +// - src/class-fields/syntax/invalid/cls-decl-fields-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 + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x #y +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js new file mode 100644 index 0000000000..dc2cccaed3 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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 +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js new file mode 100644 index 0000000000..843cd646de --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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; +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js new file mode 100644 index 0000000000..23bc067205 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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 +} diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier.js b/test/language/statements/class/syntax-valid-grammar-field-identifier.js new file mode 100644 index 0000000000..6100975d82 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier.js @@ -0,0 +1,71 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-field-identifier.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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; +} diff --git a/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js new file mode 100644 index 0000000000..cb260398d5 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js @@ -0,0 +1,30 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-fields-multi-line.case +// - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template +/*--- +description: SyntaxError (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 +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js new file mode 100644 index 0000000000..76f969b204 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer-alt.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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 +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js new file mode 100644 index 0000000000..3f97f1e0a3 --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -0,0 +1,68 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-classelementname-initializer.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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; +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js new file mode 100644 index 0000000000..dfe6c3703c --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js @@ -0,0 +1,65 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-identifier.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 + + + 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; +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js new file mode 100644 index 0000000000..93b9728f6c --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatename-no-initializer-with-method.case +// - src/class-fields/syntax/valid/cls-decl-fields-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() {} +} diff --git a/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js new file mode 100644 index 0000000000..0bef1fab1a --- /dev/null +++ b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/grammar-privatenames-multi-line.case +// - src/class-fields/syntax/valid/cls-decl-fields-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 +} From b3869474c5d04051f1c958d2ba0b428555ca6621 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 8 Aug 2018 14:08:18 -0400 Subject: [PATCH 23/40] Class Fields: static method productions --- ...tor-method-privatename-identifier-alt.case | 117 +++++++++++++++++ ...nerator-method-privatename-identifier.case | 118 ++++++++++++++++++ ...ync-method-privatename-identifier-alt.case | 117 +++++++++++++++++ ...c-async-method-privatename-identifier.case | 118 ++++++++++++++++++ ...tor-method-privatename-identifier-alt.case | 105 ++++++++++++++++ ...nerator-method-privatename-identifier.case | 106 ++++++++++++++++ ...tic-method-privatename-identifier-alt.case | 12 +- ...-static-method-privatename-identifier.case | 6 +- ...ivatename-identifier-alt-by-classname.case | 91 ++++++++++++++ ...c-privatename-identifier-by-classname.case | 91 ++++++++++++++ ...entifier-initializer-alt-by-classname.case | 85 +++++++++++++ 11 files changed, 954 insertions(+), 12 deletions(-) create mode 100644 src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-static-async-generator-method-privatename-identifier.case create mode 100644 src/class-fields/rs-static-async-method-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-static-async-method-privatename-identifier.case create mode 100644 src/class-fields/rs-static-generator-method-privatename-identifier-alt.case create mode 100644 src/class-fields/rs-static-generator-method-privatename-identifier.case create mode 100644 src/class-fields/rs-static-privatename-identifier-alt-by-classname.case create mode 100644 src/class-fields/rs-static-privatename-identifier-by-classname.case create mode 100644 src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case new file mode 100644 index 0000000000..1b5473a9ab --- /dev/null +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case @@ -0,0 +1,117 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static AsyncGeneratorMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +flags: [async] +features: [class-static-methods-private] +---*/ + +//- fields +static async #$(value) { + yield await value; +} +static async #_(value) { + yield await value; +} +static async #o(value) { + yield await value; +} +static async #℘(value) { + yield await value; +} +static async #ZW_‌_NJ(value) { + yield await value; +} +static async #ZW_‍_J(value) { + yield await value; +} +//- privateinspectionfunctions +static async $(value) { + yield * await this.#$(value); +} +static async _(value) { + yield * await this.#_(value); +} +static async o(value) { + yield * await this.#o(value); +} +static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); +} +static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); +} +static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); +} + +//- assertions +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case new file mode 100644 index 0000000000..f29b16414e --- /dev/null +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case @@ -0,0 +1,118 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static AsyncGeneratorMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +flags: [async] +features: [class-static-methods-private] +---*/ + +//- fields +static async * #$(value) { + yield await value; +} +static async * #_(value) { + yield await value; +} +static async * #\u{6F}(value) { + yield await value; +} +static async * #\u2118(value) { + yield await value; +} +static async * #ZW_\u200C_NJ(value) { + yield await value; +} +static async * #ZW_\u200D_J(value) { + yield await value; +} +//- privateinspectionfunctions +static async * $(value) { + yield * await this.#$(value); +} +static async * _(value) { + yield * await this.#_(value); +} +static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); +} +static async * \u2118(value) { + yield * await this.#\u2118(value); +} +static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); +} +static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); +} + +//- assertions +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/src/class-fields/rs-static-async-method-privatename-identifier-alt.case b/src/class-fields/rs-static-async-method-privatename-identifier-alt.case new file mode 100644 index 0000000000..57168ba172 --- /dev/null +++ b/src/class-fields/rs-static-async-method-privatename-identifier-alt.case @@ -0,0 +1,117 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static AsyncMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +flags: [async] +features: [class-static-methods-private] +---*/ + +//- fields +static async #$(value) { + return await value; +} +static async #_(value) { + return await value; +} +static async #o(value) { + return await value; +} +static async #℘(value) { + return await value; +} +static async #ZW_‌_NJ(value) { + return await value; +} +static async #ZW_‍_J(value) { + return await value; +} +//- privateinspectionfunctions +static async $(value) { + return await this.#$(value); +} +static async _(value) { + return await this.#_(value); +} +static async o(value) { + return await this.#o(value); +} +static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); +} +static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); +} +static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); +} + +//- assertions +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/rs-static-async-method-privatename-identifier.case b/src/class-fields/rs-static-async-method-privatename-identifier.case new file mode 100644 index 0000000000..b715696e6d --- /dev/null +++ b/src/class-fields/rs-static-async-method-privatename-identifier.case @@ -0,0 +1,118 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static AsyncMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +flags: [async] +features: [class-static-methods-private] +---*/ + +//- fields +static async #$(value) { + return await value; +} +static async #_(value) { + return await value; +} +static async #\u{6F}(value) { + return await value; +} +static async #\u2118(value) { + return await value; +} +static async #ZW_\u200C_NJ(value) { + return await value; +} +static async #ZW_\u200D_J(value) { + return await value; +} +//- privateinspectionfunctions +static async $(value) { + return await this.#$(value); +} +static async _(value) { + return await this.#_(value); +} +static async \u{6F}(value) { + return await this.#\u{6F}(value); +} +static async \u2118(value) { + return await this.#\u2118(value); +} +static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); +} +static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); +} + +//- assertions +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case new file mode 100644 index 0000000000..500426daba --- /dev/null +++ b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case @@ -0,0 +1,105 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static GeneratorMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-methods-private] +---*/ + +//- fields +static * #$(value) { + yield value; +} +static * #_(value) { + yield value; +} +static * #o(value) { + yield value; +} +static * #℘(value) { + yield value; +} +static * #ZW_‌_NJ(value) { + yield value; +} +static * #ZW_‍_J(value) { + yield value; +} +//- privateinspectionfunctions +static * $(value) { + yield this.#$(value); +} +static * _(value) { + yield this.#_(value); +} +static * o(value) { + yield this.#o(value); +} +static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); +} +static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); +} +static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); +} + +//- assertions +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier.case b/src/class-fields/rs-static-generator-method-privatename-identifier.case new file mode 100644 index 0000000000..0b7dd4558f --- /dev/null +++ b/src/class-fields/rs-static-generator-method-privatename-identifier.case @@ -0,0 +1,106 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static GeneratorMethod PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-methods-private] +---*/ + +//- fields +static * #$(value) { + yield value; +} +static * #_(value) { + yield value; +} +static * #\u{6F}(value) { + yield value; +} +static * #\u2118(value) { + yield value; +} +static * #ZW_\u200C_NJ(value) { + yield value; +} +static * #ZW_\u200D_J(value) { + yield value; +} +//- privateinspectionfunctions +static * $(value) { + yield this.#$(value); +} +static * _(value) { + yield this.#_(value); +} +static * \u{6F}(value) { + yield this.#\u{6F}(value); +} +static * \u2118(value) { + yield this.#\u2118(value); +} +static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); +} +static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); +} + +//- assertions +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/src/class-fields/rs-static-method-privatename-identifier-alt.case b/src/class-fields/rs-static-method-privatename-identifier-alt.case index fbcaeaad86..fb25044355 100644 --- a/src/class-fields/rs-static-method-privatename-identifier-alt.case +++ b/src/class-fields/rs-static-method-privatename-identifier-alt.case @@ -12,8 +12,8 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName @@ -51,32 +51,26 @@ info: | properties "Other_ID_Start" and "Other_ID_Continue". template: productions -features: [class-static-fields-private] +features: [class-static-methods-private] ---*/ //- fields static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } //- privateinspectionfunctions diff --git a/src/class-fields/rs-static-method-privatename-identifier.case b/src/class-fields/rs-static-method-privatename-identifier.case index b8ed91e565..b23332e770 100644 --- a/src/class-fields/rs-static-method-privatename-identifier.case +++ b/src/class-fields/rs-static-method-privatename-identifier.case @@ -12,8 +12,8 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName @@ -51,7 +51,7 @@ info: | properties "Other_ID_Start" and "Other_ID_Continue". template: productions -features: [class-static-fields-private] +features: [class-static-methods-private] ---*/ //- fields diff --git a/src/class-fields/rs-static-privatename-identifier-alt-by-classname.case b/src/class-fields/rs-static-privatename-identifier-alt-by-classname.case new file mode 100644 index 0000000000..846aca8146 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-alt-by-classname.case @@ -0,0 +1,91 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J +//- privateinspectionfunctions +static $(value) { + C.#$ = value; + return C.#$; +} +static _(value) { + C.#_ = value; + return C.#_; +} +static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; +} +static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; +} +static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; +} +static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; +} +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/src/class-fields/rs-static-privatename-identifier-by-classname.case b/src/class-fields/rs-static-privatename-identifier-by-classname.case new file mode 100644 index 0000000000..7f56d1ebe6 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-by-classname.case @@ -0,0 +1,91 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J +//- privateinspectionfunctions +static $(value) { + C.#$ = value; + return C.#$; +} +static _(value) { + C.#_ = value; + return C.#_; +} +static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; +} +static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; +} +static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; +} +static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; +} +//- assertions +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case b/src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case new file mode 100644 index 0000000000..383839a0c3 --- /dev/null +++ b/src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case @@ -0,0 +1,85 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Valid Static PrivateName +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +template: productions +features: [class-static-fields-private] +---*/ + +//- fields +static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 +//- privateinspectionfunctions +static $() { + return C.#$; +} +static _() { + return C.#_; +} +static \u{6F}() { + return C.#\u{6F}; +} +static ℘() { + return C.#℘; +} +static ZW_‌_NJ() { + return C.#ZW_‌_NJ; +} +static ZW_‍_J() { + return C.#ZW_‍_J; +} +//- assertions +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + From 331a3964d5d618a5f36e3adc4882553dd7573feb Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 10 Aug 2018 11:52:50 -0400 Subject: [PATCH 24/40] Generate tests --- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...after-same-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...same-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...er-same-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...e-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ync-gen-rs-field-identifier-initializer.js | 8 +- ...ne-static-async-gen-rs-field-identifier.js | 8 +- ...async-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...tic-async-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...generator-method-privatename-identifier.js | 136 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 136 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 124 +++++++++++++ ...generator-method-privatename-identifier.js | 125 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 110 ++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 110 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 104 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...nc-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...static-async-method-rs-field-identifier.js | 8 +- ...nc-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...-async-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 135 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 123 +++++++++++++ ...generator-method-privatename-identifier.js | 124 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 109 ++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 109 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 103 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...tic-gen-rs-field-identifier-initializer.js | 8 +- ...ame-line-static-gen-rs-field-identifier.js | 8 +- ...tatic-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...ne-static-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ic-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...-line-static-method-rs-field-identifier.js | 8 +- ...ic-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...static-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...elds-computed-name-propname-constructor.js | 32 ---- ...mputed-name-static-propname-constructor.js | 31 ---- ...ls-direct-eval-err-contains-supercall-1.js | 2 +- ...ls-direct-eval-err-contains-supercall-2.js | 2 +- ...-cls-direct-eval-err-contains-supercall.js | 2 +- ...irect-eval-err-contains-superproperty-1.js | 2 +- ...-indirect-eval-err-contains-supercall-1.js | 2 +- ...-indirect-eval-err-contains-supercall-2.js | 2 +- ...ls-indirect-eval-err-contains-supercall.js | 2 +- ...irect-eval-err-contains-superproperty-1.js | 2 +- ...elds-direct-eval-err-contains-newtarget.js | 2 +- ...ds-indirect-eval-err-contains-newtarget.js | 2 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...ultiple-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...e-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 167 +++++++++++++++++ ...generator-method-privatename-identifier.js | 168 ++++++++++++++++++ ...async-method-privatename-identifier-alt.js | 167 +++++++++++++++++ ...tic-async-method-privatename-identifier.js | 168 ++++++++++++++++++ ...rator-method-privatename-identifier-alt.js | 156 ++++++++++++++++ ...generator-method-privatename-identifier.js | 157 ++++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 142 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 142 +++++++++++++++ ...identifier-initializer-alt-by-classname.js | 136 ++++++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...stacked-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...d-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 145 +++++++++++++++ ...generator-method-privatename-identifier.js | 146 +++++++++++++++ ...async-method-privatename-identifier-alt.js | 145 +++++++++++++++ ...tic-async-method-privatename-identifier.js | 146 +++++++++++++++ ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 120 +++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 120 +++++++++++++ ...identifier-initializer-alt-by-classname.js | 114 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...w-no-sc-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...c-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...lds-new-sc-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...w-sc-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...-new-sc-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...c-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...vate-direct-eval-err-contains-newtarget.js | 2 +- ...te-indirect-eval-err-contains-newtarget.js | 2 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...regular-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...r-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...async-method-privatename-identifier-alt.js | 120 +++++++++++++ ...tic-async-method-privatename-identifier.js | 121 +++++++++++++ ...rator-method-privatename-identifier-alt.js | 109 ++++++++++++ ...generator-method-privatename-identifier.js | 110 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 95 ++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 95 ++++++++++ ...identifier-initializer-alt-by-classname.js | 89 ++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ync-gen-rs-field-identifier-initializer.js | 8 +- ...same-line-async-gen-rs-field-identifier.js | 8 +- ...async-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...ine-async-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...generator-method-privatename-identifier.js | 136 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 136 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 124 +++++++++++++ ...generator-method-privatename-identifier.js | 125 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 110 ++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 110 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 104 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...nc-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...e-line-async-method-rs-field-identifier.js | 8 +- ...nc-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...-async-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 135 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 123 +++++++++++++ ...generator-method-privatename-identifier.js | 124 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 109 ++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 109 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 103 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...ields-same-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...same-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...ds-same-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...e-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...d-in-sc-rs-field-identifier-initializer.js | 8 +- ...ields-wrapped-in-sc-rs-field-identifier.js | 8 +- ...ped-in-sc-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...c-rs-privatename-identifier-initializer.js | 10 +- ...wrapped-in-sc-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 122 +++++++++++++ ...generator-method-privatename-identifier.js | 123 +++++++++++++ ...async-method-privatename-identifier-alt.js | 122 +++++++++++++ ...tic-async-method-privatename-identifier.js | 123 +++++++++++++ ...rator-method-privatename-identifier-alt.js | 111 ++++++++++++ ...generator-method-privatename-identifier.js | 112 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 97 ++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 97 ++++++++++ ...identifier-initializer-alt-by-classname.js | 91 ++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...-in-sc-rs-static-privatename-identifier.js | 10 +- ...ate-fields-proxy-default-handler-throws.js | 4 +- ...grammar-field-def-has-initializer-no-sc.js | 31 ---- ...rammar-field-no-initializer-with-method.js | 32 ---- .../class/syntax-error-grammar-fields.js | 31 ---- ...-privatename-no-initializer-with-method.js | 35 ---- .../class/syntax-error-grammar-privatename.js | 34 ---- .../syntax-error-grammar-privatenames.js | 34 ---- ...mmar-field-identifier-invalid-ues-error.js | 6 +- ...mmar-field-identifier-invalid-zwj-error.js | 6 +- ...mar-field-identifier-invalid-zwnj-error.js | 6 +- ...yntax-invalid-grammar-privatename-error.js | 4 +- ...mmar-privatename-identifier-invalid-ues.js | 10 +- ...rivatename-identifier-invalid-zwj-error.js | 10 +- ...ivatename-identifier-invalid-zwnj-error.js | 10 +- ...ivatename-identifier-non-id-start-error.js | 65 ------- ...ar-privatename-identifier-non-ues-error.js | 65 ------- ...id-grammar-privatenames-same-line-error.js | 2 +- ...-field-classelementname-initializer-alt.js | 4 +- ...mmar-field-classelementname-initializer.js | 4 +- ...ntax-valid-grammar-field-identifier-alt.js | 4 +- .../syntax-valid-grammar-field-identifier.js | 4 +- .../syntax-valid-grammar-fields-multi-line.js | 2 +- ...tename-classelementname-initializer-alt.js | 10 +- ...rivatename-classelementname-initializer.js | 10 +- ...ax-valid-grammar-privatename-identifier.js | 10 +- ...-privatename-no-initializer-with-method.js | 2 +- ...x-valid-grammar-privatenames-multi-line.js | 2 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...after-same-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...same-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...er-same-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...e-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ync-gen-rs-field-identifier-initializer.js | 8 +- ...ne-static-async-gen-rs-field-identifier.js | 8 +- ...async-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...tic-async-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...generator-method-privatename-identifier.js | 136 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 136 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 124 +++++++++++++ ...generator-method-privatename-identifier.js | 125 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 110 ++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 110 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 104 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...nc-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...static-async-method-rs-field-identifier.js | 8 +- ...nc-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...-async-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 135 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 123 +++++++++++++ ...generator-method-privatename-identifier.js | 124 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 109 ++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 109 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 103 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...tic-gen-rs-field-identifier-initializer.js | 8 +- ...ame-line-static-gen-rs-field-identifier.js | 8 +- ...tatic-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...ne-static-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ic-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...-line-static-method-rs-field-identifier.js | 8 +- ...ic-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...static-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...ls-direct-eval-err-contains-supercall-1.js | 2 +- ...ls-direct-eval-err-contains-supercall-2.js | 2 +- ...-cls-direct-eval-err-contains-supercall.js | 2 +- ...irect-eval-err-contains-superproperty-1.js | 2 +- ...-indirect-eval-err-contains-supercall-1.js | 2 +- ...-indirect-eval-err-contains-supercall-2.js | 2 +- ...ls-indirect-eval-err-contains-supercall.js | 2 +- ...irect-eval-err-contains-superproperty-1.js | 2 +- ...elds-direct-eval-err-contains-newtarget.js | 2 +- ...ds-indirect-eval-err-contains-newtarget.js | 2 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...ultiple-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...e-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 167 +++++++++++++++++ ...generator-method-privatename-identifier.js | 168 ++++++++++++++++++ ...async-method-privatename-identifier-alt.js | 167 +++++++++++++++++ ...tic-async-method-privatename-identifier.js | 168 ++++++++++++++++++ ...rator-method-privatename-identifier-alt.js | 156 ++++++++++++++++ ...generator-method-privatename-identifier.js | 157 ++++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 142 +++++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 142 +++++++++++++++ ...identifier-initializer-alt-by-classname.js | 136 ++++++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...stacked-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...d-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 145 +++++++++++++++ ...generator-method-privatename-identifier.js | 146 +++++++++++++++ ...async-method-privatename-identifier-alt.js | 145 +++++++++++++++ ...tic-async-method-privatename-identifier.js | 146 +++++++++++++++ ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 120 +++++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 120 +++++++++++++ ...identifier-initializer-alt-by-classname.js | 114 ++++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...w-no-sc-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...c-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...lds-new-sc-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...w-sc-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...-new-sc-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...c-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...generator-method-privatename-identifier.js | 133 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 132 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 133 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 121 +++++++++++++ ...generator-method-privatename-identifier.js | 122 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 107 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 107 +++++++++++ ...identifier-initializer-alt-by-classname.js | 101 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...vate-direct-eval-err-contains-newtarget.js | 2 +- ...te-indirect-eval-err-contains-newtarget.js | 2 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...nitions-rs-field-identifier-initializer.js | 8 +- ...regular-definitions-rs-field-identifier.js | 8 +- ...finitions-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...s-rs-privatename-identifier-initializer.js | 10 +- ...r-definitions-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...async-method-privatename-identifier-alt.js | 120 +++++++++++++ ...tic-async-method-privatename-identifier.js | 121 +++++++++++++ ...rator-method-privatename-identifier-alt.js | 109 ++++++++++++ ...generator-method-privatename-identifier.js | 110 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 95 ++++++++++ ...ns-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 95 ++++++++++ ...identifier-initializer-alt-by-classname.js | 89 ++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...itions-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ync-gen-rs-field-identifier-initializer.js | 8 +- ...same-line-async-gen-rs-field-identifier.js | 8 +- ...async-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...ine-async-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...generator-method-privatename-identifier.js | 136 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 135 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 136 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 124 +++++++++++++ ...generator-method-privatename-identifier.js | 125 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 110 ++++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 110 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 104 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...nc-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...e-line-async-method-rs-field-identifier.js | 8 +- ...nc-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...-async-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...generator-method-privatename-identifier.js | 135 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 134 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 135 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 123 +++++++++++++ ...generator-method-privatename-identifier.js | 124 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 109 ++++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 109 ++++++++++++ ...identifier-initializer-alt-by-classname.js | 103 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...ine-gen-rs-field-identifier-initializer.js | 8 +- ...ields-same-line-gen-rs-field-identifier.js | 8 +- ...-line-gen-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...n-rs-privatename-identifier-initializer.js | 10 +- ...same-line-gen-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...en-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...ne-gen-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...-method-rs-field-identifier-initializer.js | 8 +- ...ds-same-line-method-rs-field-identifier.js | 8 +- ...ne-method-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...d-rs-privatename-identifier-initializer.js | 10 +- ...e-line-method-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...generator-method-privatename-identifier.js | 132 ++++++++++++++ ...async-method-privatename-identifier-alt.js | 131 ++++++++++++++ ...tic-async-method-privatename-identifier.js | 132 ++++++++++++++ ...rator-method-privatename-identifier-alt.js | 120 +++++++++++++ ...generator-method-privatename-identifier.js | 121 +++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 106 +++++++++++ ...od-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 106 +++++++++++ ...identifier-initializer-alt-by-classname.js | 100 +++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...method-rs-static-privatename-identifier.js | 10 +- ...tename-identifier-semantics-stringvalue.js | 10 +- ...d-in-sc-rs-field-identifier-initializer.js | 8 +- ...ields-wrapped-in-sc-rs-field-identifier.js | 8 +- ...ped-in-sc-rs-privatename-identifier-alt.js | 10 +- ...-privatename-identifier-initializer-alt.js | 10 +- ...c-rs-privatename-identifier-initializer.js | 10 +- ...wrapped-in-sc-rs-privatename-identifier.js | 10 +- ...rator-method-privatename-identifier-alt.js | 122 +++++++++++++ ...generator-method-privatename-identifier.js | 123 +++++++++++++ ...async-method-privatename-identifier-alt.js | 122 +++++++++++++ ...tic-async-method-privatename-identifier.js | 123 +++++++++++++ ...rator-method-privatename-identifier-alt.js | 111 ++++++++++++ ...generator-method-privatename-identifier.js | 112 ++++++++++++ ...tatic-method-privatename-identifier-alt.js | 22 +-- ...rs-static-method-privatename-identifier.js | 16 +- ...privatename-identifier-alt-by-classname.js | 97 ++++++++++ ...sc-rs-static-privatename-identifier-alt.js | 10 +- ...tic-privatename-identifier-by-classname.js | 97 ++++++++++ ...identifier-initializer-alt-by-classname.js | 91 ++++++++++ ...-privatename-identifier-initializer-alt.js | 10 +- ...atic-privatename-identifier-initializer.js | 10 +- ...-in-sc-rs-static-privatename-identifier.js | 10 +- ...ate-fields-proxy-default-handler-throws.js | 28 +++ ...grammar-field-def-has-initializer-no-sc.js | 31 ---- ...rammar-field-no-initializer-with-method.js | 32 ---- .../class/syntax-error-grammar-fields.js | 31 ---- ...-privatename-no-initializer-with-method.js | 35 ---- .../class/syntax-error-grammar-privatename.js | 34 ---- .../syntax-error-grammar-privatenames.js | 34 ---- ...mmar-field-identifier-invalid-ues-error.js | 6 +- ...mmar-field-identifier-invalid-zwj-error.js | 6 +- ...mar-field-identifier-invalid-zwnj-error.js | 6 +- ...yntax-invalid-grammar-privatename-error.js | 4 +- ...mmar-privatename-identifier-invalid-ues.js | 10 +- ...rivatename-identifier-invalid-zwj-error.js | 10 +- ...ivatename-identifier-invalid-zwnj-error.js | 10 +- ...ivatename-identifier-non-id-start-error.js | 65 ------- ...ar-privatename-identifier-non-ues-error.js | 65 ------- ...id-grammar-privatenames-same-line-error.js | 2 +- ...-field-classelementname-initializer-alt.js | 4 +- ...mmar-field-classelementname-initializer.js | 4 +- ...ntax-valid-grammar-field-identifier-alt.js | 4 +- .../syntax-valid-grammar-field-identifier.js | 4 +- .../syntax-valid-grammar-fields-multi-line.js | 2 +- ...tename-classelementname-initializer-alt.js | 10 +- ...rivatename-classelementname-initializer.js | 10 +- ...ax-valid-grammar-privatename-identifier.js | 10 +- ...-privatename-no-initializer-with-method.js | 2 +- ...x-valid-grammar-privatenames-multi-line.js | 2 +- 828 files changed, 40038 insertions(+), 3399 deletions(-) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js delete mode 100644 test/language/expressions/class/fields-computed-name-propname-constructor.js delete mode 100644 test/language/expressions/class/fields-computed-name-static-propname-constructor.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-fields.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-privatename.js delete mode 100644 test/language/expressions/class/syntax-error-grammar-privatenames.js delete mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js delete mode 100644 test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js create mode 100644 test/language/statements/class/static-private-fields-proxy-default-handler-throws.js delete mode 100644 test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js delete mode 100644 test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js delete mode 100644 test/language/statements/class/syntax-error-grammar-fields.js delete mode 100644 test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js delete mode 100644 test/language/statements/class/syntax-error-grammar-privatename.js delete mode 100644 test/language/statements/class/syntax-error-grammar-privatenames.js delete mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js delete mode 100644 test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index abc30af89f..31fbd9c027 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js index 4c9cb38386..e9fe1af222 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js index f4cd4bdd9e..7ecdcd869e 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js index a75596b0d0..10bbfa7f63 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js index 17896a22bd..7e4a049c7a 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js index c0ee0b4924..20e88310ce 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js index fafb30e5ea..80a7dfe4f0 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..fc911d0320 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..3963332d19 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..045a3015ad --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..dc66bc6b8b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b476ac548a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..04f3dda18f --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js index e3c927ecaa..7372e4720d 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js index f583254b5b..7b45208a11 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..ada5b05221 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js index 46d1a107a4..f7865d1028 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..43163c6667 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..8d08251ed4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js index cb66f59c8a..e9bf428237 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js index 9cf2145b03..2ce79ee705 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js index 18aa8bd979..db577ad230 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 7dec72eaa0..bf74279e57 100644 --- a/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js index 0a0fdebfdc..574a373ae2 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js index 89cd17b992..a3705642c3 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js index b5ea3953f9..600cd311cf 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js index 8c11ae4160..4d3fc67929 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js index ee9058804f..54a9e1ad1d 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js index b8985cd3b4..8adb68dffc 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..252484c0ad --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..e21b8a4dd5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..40e7f5f105 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..266dc9bc88 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..fa9c6081c5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..fd80b63356 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js index a450a689d0..e076c3c26f 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js index 5b00501645..6c97cb9e26 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..15f3cce394 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js index 57b8d679a3..dc58f24424 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..341e50116c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..5283ca0b9b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js index 398218314b..50ca931e6e 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js index ca2286d78f..2267dd4427 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js index 172bc77851..0393b7b011 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index 3fac03c1e5..ec7fbec04c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js index ebdad02016..87bb10775f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js index 5d6cc1dede..cdf3f000f7 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js index 9bceb8ad1f..bf0b03b253 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js index 43143675db..718948e078 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js index 8e3a001a3d..9a45f465ed 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js index c8e9e4a152..f1693b695e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..84e248f8a4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..fa4f68e1b7 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..cd4791232b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..d4209a9fd3 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9872898804 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..cca95d074c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js index c3adc2883a..8c1b3ec4ae 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static async *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js index 2e339ebfe3..3367d390f4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..41b6ead3f0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js index cefca0895d..fae74f1829 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..a646301450 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..09fce36734 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js index cf52bf9422..c35ef2e3ca 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js index 650296ac2b..b3bae16d27 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js index 6f82a68b6a..c898059164 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js index a124cb4b34..5e932402ae 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js index 6ab83cfbd0..cc3a4aef07 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js index 1913470f62..6a6270a478 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js index c319e0f2e9..df53d38f99 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js index 27b99bc832..950a23d17a 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js index b8e4f8304e..2a734e15f6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js index ce08f25507..2aeb93b8c8 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a1ebbc4c7a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f062838678 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3d80577fa5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..842b65e3b8 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..02ed350661 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..194dc3d999 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js index 3393a2553d..018063c0e9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static async m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js index 946645e069..a0124ed6dc 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..d121c08459 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js index 413a1fc6f0..bb4679d89f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..1460024a08 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..f1ce0e6a3b --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js index dd25aee729..741cc639d6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js index 5f13258900..ee6fedcc0d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js index a40dcffc39..ee079a906d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js index a3985c5b61..e1474b254c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js index 1af61bd812..2a1569c49c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js index 3c8431712e..4f2b126cae 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js index ce0b449d92..1e1df640c4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js index 0ce52d94e5..050b4e1a16 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js index 3134c68851..1b94d1d3e1 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js index af70e7e929..3e061acfc9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..7ed3135c5e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..6f0571f81c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..6b3b70942a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..86413985cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..67e21fb3f7 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..fd57c93431 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js index f282f026aa..60c3dba7c9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js index b82b9c0105..47e506abab 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..741df420b9 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js index f28b29fb0a..f6e47583c3 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..741064eb74 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..c90867a187 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js index dbc6e893cc..09254197c0 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js index d8849231f6..985e942aa7 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js index 0e240f1e59..927769ff8a 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js index c9d3d3aa49..241fbbac17 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js index 6a2095badb..077e2611e7 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js index 136b3c42f9..226bcfa0b6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js index 79caa36ce4..5432fe04a6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js index c94c0151ad..b13268cab7 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js index d22e890101..c15f65b158 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js index 60c062b25b..c264e12bc9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8b81ed9948 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..dba6451cf2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..2446833035 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..661c1e1f6c --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8ea5bb1746 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f1ce1992d4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js index 4190a189f9..cfe752d237 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js index 0195586210..cb14eea43e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..803cfa2ae4 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js index b2e00cc339..d29955a673 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..254e3236ce --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..c863d36b40 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js index 69b632cd70..3e4d054b99 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js index 2e22625d06..6258c9eb35 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js index 1dded9c225..e763c6920c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-computed-name-propname-constructor.js b/test/language/expressions/class/fields-computed-name-propname-constructor.js deleted file mode 100644 index 0050e3a7e5..0000000000 --- a/test/language/expressions/class/fields-computed-name-propname-constructor.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "constructor". - - -negative: - phase: parse - type: SyntaxError - ----*/ - -throw "Test262: This statement should not be evaluated."; - -var x = "constructor"; -var C = class { - [x]; -}; diff --git a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js deleted file mode 100644 index 748e3fb53f..0000000000 --- a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : static FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - -negative: - phase: parse - type: SyntaxError - ----*/ - -throw "Test262: This statement should not be evaluated."; - -var x = "constructor"; -var C = class { - static [x]; -}; diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js index dd380aacfe..1b897d8fcf 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js index e7a2fde569..1899fdc30b 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js @@ -9,7 +9,7 @@ flags: [generated] info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js index e518d46538..f45e7629af 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js index c7954bc69c..4471caaecd 100644 --- a/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js +++ b/test/language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index a9c97fe8cd..b707c1f8af 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index c983e887ce..ec42afd792 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -9,7 +9,7 @@ flags: [generated] info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index 44bb95f62f..b41c09f2ca 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index 9878a14a92..0c362d3483 100644 --- a/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. diff --git a/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js index 9422ebd006..45319d97c0 100644 --- a/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-direct-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js index e008008671..5be82598ac 100644 --- a/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-indirect-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js index 0712be6cc6..5f28bba197 100644 --- a/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js index 632c8c119b..ccb0922862 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js index 93f5643f5a..2182bd8c07 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js index 7052d732da..389100aaf3 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js index 739ce1027a..114b919cc0 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js index dcb8bd0091..150b9a9bee 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js index 7f418d1f4c..0a3111c0e1 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..5ccf01a63f --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,167 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..4e45cd1f00 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,168 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + m2() { return 39 } + bar = "barbaz"; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4f6a69137c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,167 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..c3b771c848 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,168 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b72e78cfb0 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,156 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + m2() { return 39 } + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..4aa37a2528 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,157 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + m2() { return 39 } + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js index 8d63cb93eb..aad1574fd9 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple fields definitions) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -61,27 +61,21 @@ var C = class { foo = "foobar"; m() { return 42 } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } m2() { return 39 } diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js index 1cd184c5c7..3beabd3caf 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple fields definitions) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..e76fe2194a --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js index b3a0eb1889..a4aecf0902 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..7d0d6a5357 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..b42dede64c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js index 6839f876e9..a60032da25 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js index 0c388f3982..d8a7f0138c 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js index 644647bd0d..ec05e80b35 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js index f555657293..cffbc53894 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js index 0ebd53481d..23e0f2edae 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js index bbf70435d5..116c52371f 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js index 602aa8cd56..5185db4a44 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js index 0e6bdc88f5..5b621643b5 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js index 803bdbe03b..d1f771e422 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js index e28f81ae7b..ead0cae70f 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..779ab2384b --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,145 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..8960c89dfb --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,146 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + foo = "foobar" + bar = "barbaz"; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b8b3896d66 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,145 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..76f37810d3 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,146 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4840c98d97 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + foo = "foobar" + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..d1ef00fc02 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + foo = "foobar" + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js index 385f8bd798..2981baa14e 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } foo = "foobar" diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js index f2cd4be402..496767613f 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..0e98462493 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js index e476161bd0..8e36a93a5c 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..c51bd453f8 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..43f072b128 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js index ab1705896e..14655baa81 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js index b8916c68b5..9c5cafff52 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js index 7ece03a60f..12a2ba0437 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js index d1379b96ba..60b5762ad2 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js index 33368c9728..2386702204 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js index 038b2feb76..0c4b4d3975 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js index fa5056e237..156eba91d7 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js index 6a082a7b0c..b889bd1468 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js index af503cae70..d819783d38 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js index f3d0cbb698..11d90ac7a8 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..042ffc2567 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..76a4c887ec --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..eab19a8ffd --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..f98fe88157 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..33950f9664 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..ada54f0158 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js index d6b0423dbb..f53ddc736f 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } m() { return 42; } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js index 42383a312e..315bf3efa5 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..5eb6aeea28 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js index 83e9e56b31..e1901a7d50 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..e36a133454 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..39d8929c47 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js index aa5f913d2c..532d44b88b 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js index 28d9712a7e..b03835cb9c 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js index be24db224f..b37c209251 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index ec6fa5ac28..61f85f900c 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js index c20042d7b9..2a90a47d81 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js index 9d90b1932c..fd7fc0eaed 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js index b3f83f12e2..89efbc4d6d 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js index 5a7ed4f9d7..3edc04ef26 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js index 131e929802..2bed89d338 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js index 303faedec2..615111f11b 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c4b9e37137 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + *m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..941da6fcbf --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + *m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d53e4a9216 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..ba7b86fe17 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d7a6c8ef22 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..154156c8e6 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js index 34b6e8aad9..da37a639cf 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; *m() { return 42; } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js index c35499141e..e0d1a96cc2 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..6a4e753196 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js index 79abd2b1d7..cb72dc839c 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..dcb5086e2b --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..6caa6e15ec --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js index 56d10480f4..3d4ce691ff 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js index 8d3616dbbb..a2aecdf301 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js index a51d2a0a70..92421ec3b7 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 5c07c4cdb3..94e7b8dab3 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js index e643193c31..951beaa393 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js index 0bf202d1f4..3d4b1884b8 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js index 068dc85b68..19e1b4ad62 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js index d041281690..f3d0fcdd58 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js index a7b65c1618..5bce1573d3 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js index 3985fcc021..48f59120f1 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..89265d3fc2 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..616f3a3f7a --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..7990d7a4dc --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..f47bbd4519 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d3ec9ff36e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..ad929a09c7 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js index d4806f6263..e03bfbbb63 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; m() { return 42; } diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js index e1f09a5315..45555d4a19 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..f06b9a21d4 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js index 3328f4b152..526c28b065 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..b1979020b5 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..fefd7689b0 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js index 362b98deac..354d4abc30 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js index ace5e03f92..5f9e79ab36 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js index cc7d1938eb..26d05e28f9 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js index 2273bc4dfd..4cff46aed7 100644 --- a/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-private-direct-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js b/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js index 42e0f30ecf..54fdb2a809 100644 --- a/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js +++ b/test/language/expressions/class/fields-private-indirect-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js index 041cfcc2e5..27060a55a2 100644 --- a/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js index 1e0e3cdde1..66a45fb468 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js index ad9c241d8f..8afe1f867b 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-field-identifier.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js index b02fcda1cd..055469d5c4 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js index c73a77c87f..c9ff8690fd 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js index bf416c4434..0ad86b1ef2 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js index 769990cab6..57e4b077bd 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d656a76097 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..6ee58c844c --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..23e406a28f --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..b5800b5c77 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..6dc6cf0c17 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..d5a380ed39 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js index c80aa0fb19..721016953d 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (regular fields defintion) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -58,27 +58,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } static $(value) { diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js index e6081cec13..2f2f562b38 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (regular fields defintion) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..6f2cef7be2 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js index 2f02754482..07baed21d8 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..dbd238fdca --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..1235ee3ee1 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js index 48835e88a7..e2cbb9e7bc 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js index bc7881bbd3..bc1cbda6c9 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js index 7d220b583c..6b92096a84 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index beb3cc2488..b748989fa0 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js index bbdfedbb51..19577f96c5 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js index beecac0890..998d5833e2 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js index 7735511177..7c5a1ade62 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js index 637644f0e4..0414c25392 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js index 87052a49a2..26e2bbeb28 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js index 087e6b602c..db34f0e027 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..60267b241e --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f43c71c90b --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c49fe30888 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..5a04dc9dd4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a2735fc801 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..3d4332e3cb --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js index 5863e85032..f996692565 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { async *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js index 3f4c9d669c..f412f24f64 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..4a67be1fdd --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js index 56c4ad6330..5bbb93a64f 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..1ee0e6c603 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..0fcad31030 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js index 7a69dae3c6..7c61c13b20 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js index 98f953fefc..8fec6d6252 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js index eb6574f69c..ef41a0853a 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js index 47e9e32ab5..dc9750b233 100644 --- a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js index b68f5a4f9a..7492d169e4 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js index f326a177f7..418b6bb5cb 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js index 2a88cedd6c..5f99dd5ece 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js index 999e3030b7..2ad6e564e1 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js index 44c1648c12..43367d150e 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js index a8e9636aa6..3ec6a7ceb2 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..26bf78ab93 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..e5122fd210 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..7a831c45c6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..8a32100ecc --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..54ebe240d2 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..cf3e86f543 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js index c313384155..fc0ec082b3 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { async m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js index 68b413796a..bfeede6da5 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..bc9f3384d3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js index ee21047e7e..3fe7bf6f27 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..db6376c81f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..2a6168162d --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js index 29310bb8d5..c5c15676b3 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js index 6776f3be0e..b372055420 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js index 290a73d447..ca85618524 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index 3ba63e3ffc..1137042dd9 100644 --- a/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js index df763485f5..b1316fda6f 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js index 6e13fd26d8..9337a10635 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js index 3d07448b0d..a8426cd70d 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js index a74bc215f8..f36b8d6c15 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js index f663a4fff8..825cfca783 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js index 307ad86868..fb102640fa 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..66d0cc40fd --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; *m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..beb17a4454 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; *m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8b47183cfb --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..3b9eae4956 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..ca5a52108f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..ca34befd92 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js index 8626d4d9ce..3918ab35d1 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; *m() { return 42; } static $(value) { diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js index e75c4c43fb..3d31b28163 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..d8836a8872 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js index 3a46e362c5..c9c2a76489 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..d423e038c1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..bfe5e23174 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js index 48dfcc5dc2..ca132e0252 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js index d9fd2bd514..582f446ed1 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js index 95394cbfc4..c2e6413009 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 43d49b5254..b96b8580ed 100644 --- a/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js index d75572687c..627e25df6b 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js index 52788e419e..fbedc11a31 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js index 6a65f2782d..a404b09cac 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js index 2fcabecf4e..cc836dc7a4 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js index 0204afa5e6..3c7bba56d8 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js index b105329911..a509074c7c 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8bd431c404 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..ef3c0c7ad4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..df91eba8c4 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..94acd5fb90 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3cc1e09920 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..5dfeb484e6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js index 3aad6acb36..deb0728cb3 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; m() { return 42; } static $(value) { diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js index 7079bb7a6f..336bb8b1d9 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..cf64819064 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js index e60739d025..b37f3ef8d3 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..d731183f00 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..9979389007 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js index 4490b98386..be2a90f3a6 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js index 54220041d4..3ebb2f1816 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js index cc08c93317..36681c0beb 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js index 53c726d831..c29dc26069 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js index 6a13112465..651ba78411 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js index 77f2f760df..900646d589 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js index b7e59d2270..85d8769800 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js index 1590c6fbec..b92351ee56 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js index 4e9eb7d88d..5e5b6d2fe0 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js index dc07187285..423f695d09 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..826c112aa8 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + };;;;;;; + ;;;; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..57027d8e82 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + };;;;;;; + ;;;; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..21f9222941 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + };;;;;;; + ;;;; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..d0322faa9b --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + };;;;;;; + ;;;; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d4c4195bb9 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,111 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + };;;;;;; + ;;;; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..4331108e29 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + };;;;;;; + ;;;; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js index d451faabf1..da67af6171 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (fields definition wrapped in semicolons) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | var C = class { ;;;; ;;;;;;static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; };;;;;;; ;;;; diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js index 718e57c760..81eb74e209 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (fields definition wrapped in semicolons) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..2bb649ac3c --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js index 56476171f5..72fdc5a461 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..032f6f5445 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..c454787325 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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". + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js index 91f24eddda..5a78f0f152 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js index 600d128f4b..6878665575 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js index 96d00ea178..a311dbfb48 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js b/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js index 9649b5406a..86a59a668f 100644 --- a/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js +++ b/test/language/expressions/class/static-private-fields-proxy-default-handler-throws.js @@ -22,7 +22,7 @@ var C = class { var P = new Proxy(C, {}); -assert.sameValue(C.x, 1); +assert.sameValue(C.x(), 1); assert.throws(TypeError, function() { - P.x; + P.x(); }); diff --git a/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js deleted file mode 100644 index fbaef4ff02..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-field-def-has-initializer-no-sc.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -esid: prod-ClassElement -features: [class-fields-private, class] -flags: [generated] -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - x = [] -}; diff --git a/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js deleted file mode 100644 index 8d5165aeea..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-field-no-initializer-with-method.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-no-initializer-with-method.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -esid: prod-ClassElement -features: [class-fields-private, class] -flags: [generated] -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - x - m() {} -}; diff --git a/test/language/expressions/class/syntax-error-grammar-fields.js b/test/language/expressions/class/syntax-error-grammar-fields.js deleted file mode 100644 index 6407595550..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-fields.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-fields.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -esid: prod-ClassElement -features: [class-fields-public, class] -flags: [generated] -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - x y -}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js deleted file mode 100644 index fd4b1769c8..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-privatename-no-initializer-with-method.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-no-initializer-with-method.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - #x - m() {} -}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatename.js b/test/language/expressions/class/syntax-error-grammar-privatename.js deleted file mode 100644 index 27af62cf40..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-privatename.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - # x -}; diff --git a/test/language/expressions/class/syntax-error-grammar-privatenames.js b/test/language/expressions/class/syntax-error-grammar-privatenames.js deleted file mode 100644 index 8ee4dfe277..0000000000 --- a/test/language/expressions/class/syntax-error-grammar-privatenames.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatenames.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - #x #y -}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js index e12ecfb47f..2a6f584d7b 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-ues-error.case // - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js index 9dd80bef4e..ed1209dbcb 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-zwj-error.case // - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js index efed7d1a68..2fb44276e4 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case // - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class expression) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js index 9fa2055c0d..378ea8d9ea 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-privatename-error.case // - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template /*--- -description: SyntaxError (class expression) +description: No space allowed between sigial and IdentifierName (class expression) esid: prod-ClassElement features: [class-fields-private, class] flags: [generated] @@ -24,7 +24,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js index 07c84a94b3..b7675a2758 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js index ff96485732..e6ddc39884 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js index 4e5187f254..673cd74c5c 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js deleted file mode 100644 index 6628fbc8c5..0000000000 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: Valid PrivateName Syntax (class expression) -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 - - - 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". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - #\u{00}; -}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js deleted file mode 100644 index c652458c3c..0000000000 --- a/test/language/expressions/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-identifier-non-ues-error.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: Valid PrivateName Syntax (class expression) -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 - - - 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". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - #\u0000; -}; diff --git a/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js index 3c784f2c8a..808025a871 100644 --- a/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js +++ b/test/language/expressions/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -24,7 +24,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js index 2208a98776..424abf5774 100644 --- a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js index 9d5f47865f..0580ae14ec 100644 --- a/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js +++ b/test/language/expressions/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js index 66d2ac85ca..c7aaad46d7 100644 --- a/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier-alt.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-valid-grammar-field-identifier.js b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js index 84e3d3babf..751697b188 100644 --- a/test/language/expressions/class/syntax-valid-grammar-field-identifier.js +++ b/test/language/expressions/class/syntax-valid-grammar-field-identifier.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js index 31c2a2636a..48b39d2ca5 100644 --- a/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js +++ b/test/language/expressions/class/syntax-valid-grammar-fields-multi-line.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-fields-multi-line.case // - src/class-fields/syntax/valid/cls-expr-fields-valid-syntax.template /*--- -description: SyntaxError (class expression) +description: Valid multi-line, multi-field (class expression) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js index 402984e744..cb310e0021 100644 --- a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -21,26 +21,26 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName Initializer : = AssignmentExpression - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js index 2300ceb9bb..d9e6c49655 100644 --- a/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -21,26 +21,26 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName Initializer : = AssignmentExpression - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js index 3dd423e459..283eb780bc 100644 --- a/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js index 59c168d547..4b66f99726 100644 --- a/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js +++ b/test/language/expressions/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -21,7 +21,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js index 12c752cead..33ae15a190 100644 --- a/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js +++ b/test/language/expressions/class/syntax-valid-grammar-privatenames-multi-line.js @@ -21,7 +21,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index f0d5d3d869..d75224d3f4 100644 --- a/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js index bb5b0c29cb..6b30d43bd9 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js index 8ad3b28987..cc8d4da3e5 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js index d3ff9843a6..fa7f44be75 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js index 57020b3038..a0b7b95926 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js index 3ed96ba41e..d92d4a349f 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js index 21c2743ab5..148e8316dd 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..9371edf280 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..530f0feddb --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..2e5a52fb1a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..17737b4de4 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..7f9fdda341 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..0cefd9ca02 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js index 9d7602d88a..81d5f8a4c1 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js index 10801eb81d..d286e9192c 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..ae4dfe1085 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js index 77b9bc9dc6..f93a60dcc1 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..d83143d05a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..26412e49f6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js index 31184005f2..828d7cf6bb 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js index 879397ec08..e20380d0fc 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js index 68718363b5..fc731bd88f 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 61b6da15b2..da5e252052 100644 --- a/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js index fb52206576..334f5ec285 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js index baad9d3789..69d97d811e 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js index 0df46fd173..71be3d826b 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js index 0ec2d10a1a..f2bac39182 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js index ca70313036..7702905866 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js index e5a1a42578..fca2d35e25 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..314c7a6157 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..fcf17e7581 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..75d8b18954 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..6bba34272b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1ff8aa7651 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f0fd6fe03d --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js index 9307410f92..655b12f335 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js index c8674d0806..d01ecc5d87 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..15efc9e014 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js index 5966b9f911..5e4685a351 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..574b0cd95a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..b96c6491ca --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js index 1a79b9f781..70f4654933 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js index 0effbde88b..dc566dee26 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js index 225353687c..01ee0a655f 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index 00a11b1b80..4193fd5db7 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js index 31e9d4bd02..c0d859ba0d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js index 37a91f8367..84fe450313 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js index 2e3f7e474d..545545a679 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js index 71ba207ac6..3e40782756 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js index cb27bfb4e8..0bae129936 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js index 88e75b193c..ae07249fe7 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..69a1935680 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..34953644e6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..894787f2c8 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..b99a59d829 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..efb94dcd9f --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..e7b11c3084 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js index 1dbf9e7330..2f1ced3434 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static async *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js index 8cc3b1eaf3..9bd6795357 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..e0c1b6eac9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js index 3d53db9e2b..74f43bce35 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..27fc914429 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..caeb85e57e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js index dc2457f1b4..5e596a3b25 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js index 6e0bd25a22..b1ae4c245b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js index e154ad948d..1859796b85 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js index af52cae65b..e4b1f887e2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js index 9cd2102348..ccc54913a7 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js index f265b554a1..2fbf002c49 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js index 2c1614bf00..eb06ab96dd 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js index e77d1ee1d6..6ac29798eb 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js index 615777f71f..4a717a34d0 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js index 6dd90ca9d8..456a141c7a 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..2ae364efaf --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..7a20229408 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..cd55d42a01 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..8723f43953 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f8b8fbb120 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..eaa3d8e082 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js index a90f56c3fe..a47214d972 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static async m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js index e3ae14e8dc..5519040ed4 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..424a78f852 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js index 79460938b7..8b3699533c 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..7a9b92ba26 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..883090c625 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +C.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js index a3a825ad92..f290fda1c2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js index bf5c8cc24f..ea5be51cc4 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js index a38f6c4d74..bbf4349800 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js index 0991ff9354..d6a424d25d 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js index 5d3c96d910..ff9665046e 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js index 30d0d1e4e9..d3e63faa91 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js index 30ccd4f707..20a5b47ed1 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js index a924e0a11f..b67f76c474 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js index f8a948131c..6e11bd2fa2 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js index 682f1fdabc..d93ec247c9 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..400d167e2b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..6880c808e9 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4ed6420d6a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..6ff146d729 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..bf3f71dada --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..e9ab085db6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js index 910ec2e31c..219ca19314 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js index 8df748077f..08d95b8ba2 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, generators, class, class-fields-public] +features: [class-static-methods-private, generators, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..8d4d2322d6 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js index 8eba30baf7..f25a6d1de1 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..342cfcfe8a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..316571e430 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Valid Static PrivateName (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js index aa4abf04b3..06e10db2d3 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js index 2e0cbb484c..f008e11b3c 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js index 9ee640049e..18776b0c36 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js index 82393b1bfe..f4d6073a84 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js index 24fb8b5632..30d4c55e83 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js index cff5a7f9c9..69af3c1dc7 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js index afe1dcac02..106db2b63a 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js index 047f50e714..6cade15711 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js index 73abdab8c2..e32bda4914 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js index d736747c32..f753d298fb 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..2766d3c61e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..aaaf0f82d5 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..aa5e779b87 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..cb7c0ea53e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b8edca96f4 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..eb84e88ae7 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js index 35b58661cf..356e56fb90 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js index 4d9376e51b..c85aa20561 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after a static method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..66809e3421 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js index a4df060683..22a94cf276 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..9692e0802a --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..a3fe6c07f3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Valid Static PrivateName (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js index 75fffcc2fd..9fac777757 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js index 222e3c3d0c..a9a98342b1 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js index 59fd93d265..eb9906bb7e 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js index 7520e6546f..c7f58fca98 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js index 75612496c5..4d75ecdde5 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js @@ -9,7 +9,7 @@ flags: [generated] info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js index c5f63012a8..808c80f674 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js index ca04c448dc..88c47f2c7e 100644 --- a/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index 7ee11c41d4..a8375776ce 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index 9de84949fd..586a59e3b0 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -9,7 +9,7 @@ flags: [generated] info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index 1ba08ba625..d4999d75df 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Constructor Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperCall. diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index c2520d7416..ddeafb7253 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Methods These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains SuperProperty. diff --git a/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js b/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js index d0768c666d..b634e68664 100644 --- a/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-direct-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js b/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js index 3296a5902e..0bccd2bc43 100644 --- a/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-indirect-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js index e749c637b5..ff9937bd55 100644 --- a/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-multiple-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js index 687a0e89b5..94be02f9f3 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js index 90f5beeac8..5cec156761 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js index 2ff87867ef..62a36300c3 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js index 6f79a3983d..f427a32a6f 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js index 2d0407dcc9..71c7dcaedb 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js index 83e1449291..938faa6334 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..688ee936d3 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,167 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..d124b7bb70 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,168 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + m2() { return 39 } + bar = "barbaz"; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b52b87c40d --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,167 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..74e830b358 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,168 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + m2() { return 39 } + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b5dad58cf6 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,156 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + m2() { return 39 } + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..65606f3995 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,157 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + m2() { return 39 } + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js index bcfb8748ea..39e4a7ef52 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple fields definitions) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -61,27 +61,21 @@ class C { foo = "foobar"; m() { return 42 } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } m2() { return 39 } diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js index 09478b3851..e0c00429ed 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple fields definitions) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..1f29e1ab8d --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js index dfdd73f063..b544a1c60c 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..e0e4a8f7a0 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,142 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m2() { return 39 } + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..817bcbeb8c --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Valid Static PrivateName (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + foo = "foobar"; + m() { return 42 } + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m2() { return 39 } + bar = "barbaz"; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js index bca1831262..1ac713647c 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js index c21ea4bfe3..a0002bd89b 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js index 00fd6c1921..5648b487ea 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js index 22fa2b0da1..e3f03241c6 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js index 76c04b7d49..1e42a966f2 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js index e247070e43..ac5a0d4f62 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js index aa000ad656..400e5d122a 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js index ab1bb85ab4..2c29899a91 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js index bae395d9ac..d6cde65650 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js index 272bc0f863..0cc988d492 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..09ade3dbfc --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,145 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..356fd53748 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,146 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + foo = "foobar" + bar = "barbaz"; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d1b3bc5e5b --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,145 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..2f730082f1 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,146 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + foo = "foobar" + bar = "barbaz"; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..a12442c283 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + foo = "foobar" + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..346e65cdcf --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + foo = "foobar" + bar = "barbaz"; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js index ef23039467..ad1c524bc2 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } foo = "foobar" diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js index 93d348a85a..22ce49c276 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..d91358809b --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js index 9342cb0df3..81667e7b9a 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..0323d1ba9f --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + foo = "foobar" + bar = "barbaz"; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..00195547ae --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,114 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Valid Static PrivateName (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + foo = "foobar" + bar = "barbaz"; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js index 13c7d5b6ad..85c20cf305 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js index 298fcd3813..1adf864b9c 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js index 216abbc8b8..44ef30e084 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 9c0ac0843a..4925722e93 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js index 360326b4af..336fe868c2 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js index 119e961590..05eb5931be 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js index 7d2e2a20ab..ae4ead1bee 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js index 5f3108daea..a1ad8147cb 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js index b379b24f68..e5f0a53435 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js index bd161b009e..481fc5a891 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..605fb4537e --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..239d4919c1 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..cb354f463c --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..b259234b52 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..7239d18edc --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..bca48ba4d3 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js index def9522ced..5220efc71a 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } m() { return 42; } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js index bf2d74877f..2fe934206a 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..d27341dd51 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js index ef29d93d2f..a93c8ded30 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..162255ce39 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..22b4b6fbee --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js index 5dffc941b5..0df69cf6d5 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js index d0d2db69d9..d5050f0a43 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js index 002c1424d0..416caf6200 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index 98b45a5a8f..8c6791490b 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-new-sc-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js index 467ee066d3..45af15f7ad 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js index e61355b381..c60648fb25 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js index b5a7337abc..f32323d0e2 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js index a2302883ff..28e4c9228b 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js index c5841d293e..37dae23239 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js index 07e31b0595..e2ae88a41c 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..e078209aa4 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + *m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..12b2d42c5e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + *m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..6dfdfb9909 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..d779f84a50 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..c52d4f24fa --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..1f5549752a --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js index 09243ce857..cea6b52d28 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; *m() { return 42; } diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js index 037f0af699..7792dae9fd 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..4d5c49496d --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js index de4903af25..d1f86032cf 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..034439b2c7 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..82e426f573 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + *m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js index 022c50d953..791b9e1788 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js index a0d77cef6b..841cf473fe 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js index 2082647210..f9704b0063 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 619efe11e3..d272ebd40c 100644 --- a/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-new-sc-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js index 2b98490a54..95406886db 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js index 77075206b3..46d3ad2a29 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js index 781cc7baa0..9b2a0a5bc9 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js index a68c9c672b..5778a7e7fe 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js index 0be603cf23..522c5b447c 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js index 77965045d0..bebf9ffcbd 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..3b129d8707 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..deac127cb8 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..ec00e6e04e --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..beb4f5bd90 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,133 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..00afe0eeb1 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f1563bbf98 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js index aef53585d1..17d00c2832 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; m() { return 42; } diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js index d5b6f83f37..fc1c9d27ee 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..8179a2faa1 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js index a220ddb736..edbabcddca 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..a341b4c725 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,107 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..f24913feba --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,101 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js index 32f572cf7e..bbdadd514d 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js index ddfc226c3c..cb3d1d82fb 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js index e6d17b1502..1e5bf716f5 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js b/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js index d44434ad17..aa430ae65a 100644 --- a/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-private-direct-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js b/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js index c15dd203a9..cdae3ddf4b 100644 --- a/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js +++ b/test/language/statements/class/fields-private-indirect-eval-err-contains-newtarget.js @@ -16,7 +16,7 @@ info: | Additional Early Error Rules for Eval Outside Functions These static semantics are applied by PerformEval when a direct eval call occurs outside of any function. - ScriptBody:StatementList + ScriptBody : StatementList It is a Syntax Error if StatementList Contains NewTarget. diff --git a/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js index 3b6200a167..dcc303059c 100644 --- a/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-regular-definitions-grammar-privatename-identifier-semantics-stringvalue.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js index 6439266ac6..1f1c3bf839 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier-initializer.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js index 719660f778..5b8c7588e1 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-field-identifier.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js index 8d063826b9..1fc3b02433 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js index 9e7e93dc4a..73a5c7a433 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js index b943795c9e..0a80f05c5c 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier-initializer.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js index 0f123c614f..edbc1f65cf 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4ca3001048 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..4d384515f0 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d7f37d5db9 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..6da17cffe5 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static AsyncMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..87235f63cb --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f2444b4a57 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static GeneratorMethod PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js index f32831af59..20c0bcb0d7 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (regular fields defintion) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -58,27 +58,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; } static $(value) { diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js index f825b5cd62..f55b60533c 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (regular fields defintion) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..bf23ca52cf --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js index a0834c7e2c..568f333fda 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..8874f71243 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,95 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..f459ce5a89 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,89 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Valid Static PrivateName (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1 + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js index d53d2260f5..546b552552 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js index 169139c146..d1a39b71b7 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js index 9fe26d29d5..6813941f1e 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index 684c6cde62..6bd67d046c 100644 --- a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js index 96d9b0a9cd..6906aadfa1 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js index 45fb9c76a7..8db7ab527c 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js index 01b1b15be3..316381c808 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js index 1d3fef8e89..a2d85fa476 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js index fe793e6a42..71ad00009a 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js index 01b1418205..992843e45c 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..263742e08c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..c63da90036 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..d5b17a2aa2 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..448e95ffdf --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,136 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..8557f9e155 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..2310df37d4 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,125 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js index 95282d0a0f..3a5dbc94e5 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { async *m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js index 63d11f1ee3..34822c8641 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async generator in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-iteration] +features: [class-static-methods-private, class, class-fields-public, async-iteration] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..ff06256006 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js index 6649adc942..5c9a05df8e 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..64fa0b3f17 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,110 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..832d2cfc79 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,104 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Valid Static PrivateName (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async *m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js index 38a850f4ad..15d9c9b353 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js index 15731e6585..c5b703caea 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js index 4ee4955df7..2c2149d586 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js index 1ee7dd8fd3..b1a083f770 100644 --- a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js index 292a5c4b39..e1b07b248c 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js index fd0af86be3..9ab607ddbf 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js index 88897a8a75..a0819035aa 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js index bc7ec4d60f..79ade95804 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js index d695c6068d..35db4d8d0a 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js index d4c78171b2..0ff930c120 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..1807d1e71c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..1d10947d30 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..bf618bbd90 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,134 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..021a6ac3a5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,135 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..f20de2c3e5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..f6815bb66a --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,124 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js index 1e8d884956..ce2eda176b 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { async m() { return 42; } static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; static $(value) { diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js index 4689824b50..2ab524d63c 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions after an async method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, async-functions] +features: [class-static-methods-private, class, class-fields-public, async-functions] flags: [generated, async] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..b24220655b --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js index 874375753a..582e865cd8 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..f5b8fc84c5 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,109 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..ea9823cf4b --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Valid Static PrivateName (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + async m() { return 42; } static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + + +c.m().then(function(v) { + assert.sameValue(v, 42); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js index a6a4e362c6..ae9e7f7b81 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js index fb5b87f15c..69aa0a43fc 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js index 723f1ab635..0508e4fc0e 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js index 8a26a88ca0..4cb919e79d 100644 --- a/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js index 730cf1ab8f..426c82042a 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js index bbb8c36526..99711c1081 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js index 5f6cdf2a78..46ed8603b4 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js index ca55902848..02c4fd5744 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js index eb13a59e9a..1f9775cb93 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js index ebf2311b1c..b8ae2860f9 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..34c52e35be --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; *m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..d1bf17f7d0 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; *m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..6c644a85a8 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..b292987488 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; *m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..96c7fd2324 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..7487f8a298 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; *m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js index 16754b1bab..bb74a09ac4 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; *m() { return 42; } static $(value) { diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js index aef62fd988..ba3900d6ca 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public, generators] +features: [class-static-methods-private, class, class-fields-public, generators] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..aa08600a95 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js index 3180736ccc..773fb6878b 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..b69d69738d --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; *m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..966b29a569 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Valid Static PrivateName (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; *m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js index ef96d042d7..25035ef464 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js index 460d9d2caf..39cb60711c 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js index a217c90f53..7fcc9f4b0d 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js index 2d4adbcbf6..d777013583 100644 --- a/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js index 6da87a0772..4071d75c24 100644 --- a/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier-initializer.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js index 532cf1574d..be04a97680 100644 --- a/test/language/statements/class/fields-same-line-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-field-identifier.js @@ -27,20 +27,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js index 5b8e75fe25..bf0fd0ebbc 100644 --- a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js index d5cab7a721..4782feedb8 100644 --- a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js index 99a60d4a1d..f829de55ad 100644 --- a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js index 0476a72839..e9685f8ddd 100644 --- a/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..283f4bb57c --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + }; m() { return 42; } + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..9852b31b81 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + }; m() { return 42; } + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..04e0616d3a --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,131 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + }; m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..8931afd3cd --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,132 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static AsyncMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + }; m() { return 42; } + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..4db8cae136 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,120 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + }; m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..d69787b1dd --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,121 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + }; m() { return 42; } + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js index da60f6ade0..6015f117ee 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; }; m() { return 42; } static $(value) { diff --git a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js index 2a8e5726c2..1ec92a2cef 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (field definitions followed by a method in the same line) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] includes: [propertyHelper.js] info: | @@ -16,30 +16,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..1be9cfa4cb --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J; m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js index c50fc6c5c7..ad9fc5fe32 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..f1c49c6b4e --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J; m() { return 42; } + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..18cd2ac394 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,100 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Valid Static PrivateName (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1; m() { return 42; } + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js index c840d5639d..d419e8f129 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer-alt.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js index 5bdd621782..0192cf9b07 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier-initializer.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js index 27d499712f..3ffe384b22 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-privatename-identifier.js @@ -23,23 +23,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js index b4b458afbb..4a417ea30a 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-wrapped-in-sc-grammar-privatename-identifier-semantics-stringvalue.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js index 0b36001dc4..bf235849d0 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier-initializer.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js index 9ed86d6da1..f146e6d7fb 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-field-identifier.js @@ -26,20 +26,20 @@ info: | LiteralPropertyName : IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js index c0d6bb22dd..d261e10ee5 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js index 63f406d8f5..6b409945c1 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer-alt.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js index 6803fd8731..0ef95fe37d 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier-initializer.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js index d6d84e59db..c7463d4662 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..b9c70eec7f --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static async #$(value) { + yield await value; + } + static async #_(value) { + yield await value; + } + static async #o(value) { + yield await value; + } + static async #℘(value) { + yield await value; + } + static async #ZW_‌_NJ(value) { + yield await value; + } + static async #ZW_‍_J(value) { + yield await value; + };;;;;;; + ;;;; + static async $(value) { + yield * await this.#$(value); + } + static async _(value) { + yield * await this.#_(value); + } + static async o(value) { + yield * await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield * await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..4955ed2681 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static AsyncGeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncGeneratorMethod + + AsyncGeneratorMethod : + async [no LineTerminator here] * ClassElementName ( UniqueFormalParameters){ AsyncGeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static async * #$(value) { + yield await value; + } + static async * #_(value) { + yield await value; + } + static async * #\u{6F}(value) { + yield await value; + } + static async * #\u2118(value) { + yield await value; + } + static async * #ZW_\u200C_NJ(value) { + yield await value; + } + static async * #ZW_\u200D_J(value) { + yield await value; + };;;;;;; + ;;;; + static async * $(value) { + yield * await this.#$(value); + } + static async * _(value) { + yield * await this.#_(value); + } + static async * \u{6F}(value) { + yield * await this.#\u{6F}(value); + } + static async * \u2118(value) { + yield * await this.#\u2118(value); + } + static async * ZW_\u200C_NJ(value) { + yield * await this.#ZW_\u200C_NJ(value); + } + static async * ZW_\u200D_J(value) { + yield * await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), +]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..17664b86be --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier-alt.js @@ -0,0 +1,122 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #o(value) { + return await value; + } + static async #℘(value) { + return await value; + } + static async #ZW_‌_NJ(value) { + return await value; + } + static async #ZW_‍_J(value) { + return await value; + };;;;;;; + ;;;; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async o(value) { + return await this.#o(value); + } + static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#℘(value); + } + static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‌_NJ(value); + } + static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + return await this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js new file mode 100644 index 0000000000..b8905eb225 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-method-privatename-identifier.js @@ -0,0 +1,123 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-async-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static AsyncMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated, async] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + AsyncMethod + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ){ AsyncFunctionBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static async #$(value) { + return await value; + } + static async #_(value) { + return await value; + } + static async #\u{6F}(value) { + return await value; + } + static async #\u2118(value) { + return await value; + } + static async #ZW_\u200C_NJ(value) { + return await value; + } + static async #ZW_\u200D_J(value) { + return await value; + };;;;;;; + ;;;; + static async $(value) { + return await this.#$(value); + } + static async _(value) { + return await this.#_(value); + } + static async \u{6F}(value) { + return await this.#\u{6F}(value); + } + static async \u2118(value) { + return await this.#\u2118(value); + } + static async ZW_\u200C_NJ(value) { + return await this.#ZW_\u200C_NJ(value); + } + static async ZW_\u200D_J(value) { + return await this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), +]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + +}, $DONE).then($DONE, $DONE); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js new file mode 100644 index 0000000000..6f6590341d --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -0,0 +1,111 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #o(value) { + yield value; + } + static * #℘(value) { + yield value; + } + static * #ZW_‌_NJ(value) { + yield value; + } + static * #ZW_‍_J(value) { + yield value; + };;;;;;; + ;;;; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * o(value) { + yield this.#o(value); + } + static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#℘(value); + } + static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‌_NJ(value); + } + static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + yield this.#ZW_‍_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.o(1).next().value, 1); +assert.sameValue(C.℘(1).next().value, 1); +assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); +assert.sameValue(C.ZW_‍_J(1).next().value, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js new file mode 100644 index 0000000000..864a3b405b --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -0,0 +1,112 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-generator-method-privatename-identifier.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static GeneratorMethod PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + MethodDefinition : + GeneratorMethod + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){ GeneratorBody } + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static * #$(value) { + yield value; + } + static * #_(value) { + yield value; + } + static * #\u{6F}(value) { + yield value; + } + static * #\u2118(value) { + yield value; + } + static * #ZW_\u200C_NJ(value) { + yield value; + } + static * #ZW_\u200D_J(value) { + yield value; + };;;;;;; + ;;;; + static * $(value) { + yield this.#$(value); + } + static * _(value) { + yield this.#_(value); + } + static * \u{6F}(value) { + yield this.#\u{6F}(value); + } + static * \u2118(value) { + yield this.#\u2118(value); + } + static * ZW_\u200C_NJ(value) { + yield this.#ZW_\u200C_NJ(value); + } + static * ZW_\u200D_J(value) { + yield this.#ZW_\u200D_J(value); + } + +} + +var c = new C(); + +assert.sameValue(C.$(1).next().value, 1); +assert.sameValue(C._(1).next().value, 1); +assert.sameValue(C.\u{6F}(1).next().value, 1); +assert.sameValue(C.\u2118(1).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); +assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js index 16561b43e5..ae1fa76933 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier-alt.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (fields definition wrapped in semicolons) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: @@ -59,27 +59,21 @@ info: | class C { ;;;; ;;;;;;static #$(value) { - this.$ = value; return value; } static #_(value) { - this.#stored = value; return value; } static #o(value) { - this.#stored = value; return value; } static #℘(value) { - this.#stored = value; return value; } static #ZW_‌_NJ(value) { - this.#stored = value; return value; } static #ZW_‍_J(value) { - this.#stored = value; return value; };;;;;;; ;;;; diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js index 8801041a42..1b96159f87 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-method-privatename-identifier.js @@ -4,7 +4,7 @@ /*--- description: Valid Static Method PrivateName (fields definition wrapped in semicolons) esid: prod-FieldDefinition -features: [class-static-fields-private, class, class-fields-public] +features: [class-static-methods-private, class, class-fields-public] flags: [generated] info: | @@ -15,30 +15,30 @@ info: | static FieldDefinition ; ; - FieldDefinition : - ClassElementName Initializer _opt + MethodDefinition : + ClassElementName ( UniqueFormalParameters ){ FunctionBody } ClassElementName : PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js new file mode 100644 index 0000000000..5c18c011d3 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt-by-classname.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-alt-by-classname.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #℘; static #ZW_‌_NJ; static #ZW_‍_J;;;;;;; + ;;;; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static o(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#℘ = value; + return C.#℘; + } + static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‌_NJ = value; + return C.#ZW_‌_NJ; + } + static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD + C.#ZW_‍_J = value; + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.o(1), 1); +assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD +assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js index b17e1c0926..7c839f76e6 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js new file mode 100644 index 0000000000..16b297b283 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-by-classname.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-by-classname.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$; static #_; static #\u{6F}; static #\u2118; static #ZW_\u200C_NJ; static #ZW_\u200D_J;;;;;;; + ;;;; + static $(value) { + C.#$ = value; + return C.#$; + } + static _(value) { + C.#_ = value; + return C.#_; + } + static \u{6F}(value) { + C.#\u{6F} = value; + return C.#\u{6F}; + } + static \u2118(value) { + C.#\u2118 = value; + return C.#\u2118; + } + static ZW_\u200C_NJ(value) { + C.#ZW_\u200C_NJ = value; + return C.#ZW_\u200C_NJ; + } + static ZW_\u200D_J(value) { + C.#ZW_\u200D_J = value; + return C.#ZW_\u200D_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(1), 1); +assert.sameValue(C._(1), 1); +assert.sameValue(C.\u{6F}(1), 1); +assert.sameValue(C.\u2118(1), 1); +assert.sameValue(C.ZW_\u200C_NJ(1), 1); +assert.sameValue(C.ZW_\u200D_J(1), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js new file mode 100644 index 0000000000..3cfe37c481 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -0,0 +1,91 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/rs-static-privatename-identifier-initializer-alt-by-classname.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Valid Static PrivateName (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + + ClassElement : + MethodDefinition + static MethodDefinition + FieldDefinition ; + static FieldDefinition ; + ; + + FieldDefinition : + ClassElementName Initializer _opt + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + IdentifierName :: + IdentifierStart + IdentifierName IdentifierPart + + IdentifierStart :: + UnicodeIDStart + $ + _ + \ UnicodeEscapeSequence + + IdentifierPart:: + UnicodeIDContinue + $ + \ UnicodeEscapeSequence + + + 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 { + ;;;; + ;;;;;;static #$ = 1; static #_ = 1; static #\u{6F} = 1; static #℘ = 1; static #ZW_‌_NJ = 1; static #ZW_‍_J = 1;;;;;;; + ;;;; + static $() { + return C.#$; + } + static _() { + return C.#_; + } + static \u{6F}() { + return C.#\u{6F}; + } + static ℘() { + return C.#℘; + } + static ZW_‌_NJ() { + return C.#ZW_‌_NJ; + } + static ZW_‍_J() { + return C.#ZW_‍_J; + } +} + +var c = new C(); + +assert.sameValue(C.$(), 1); +assert.sameValue(C._(), 1); +assert.sameValue(C.\u{6F}(), 1); +assert.sameValue(C.℘(), 1); +assert.sameValue(C.ZW_‌_NJ(), 1); +assert.sameValue(C.ZW_‍_J(), 1); + diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js index a680c61c5c..98d9d89dae 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer-alt.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js index 93b92daff4..e11da6abc2 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier-initializer.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js index 4725ed7115..6a2ace3c27 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-privatename-identifier.js @@ -22,23 +22,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/static-private-fields-proxy-default-handler-throws.js b/test/language/statements/class/static-private-fields-proxy-default-handler-throws.js new file mode 100644 index 0000000000..137797ec85 --- /dev/null +++ b/test/language/statements/class/static-private-fields-proxy-default-handler-throws.js @@ -0,0 +1,28 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-privatefieldget +description: Static private fields not accessible via default Proxy handler +info: | + 1. Assert: P is a Private Name value. + 2. If O is not an object, throw a TypeError exception. + 3. Let entry be PrivateFieldFind(P, O). + 4. If entry is empty, throw a TypeError exception. + +features: [class, class-static-fields-private] +---*/ + +class C { + static #x = 1; + static x() { + return this.#x; + } +} + +var P = new Proxy(C, {}); + +assert.sameValue(C.x(), 1); +assert.throws(TypeError, function() { + P.x(); +}); diff --git a/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js b/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js deleted file mode 100644 index 4dfed1839e..0000000000 --- a/test/language/statements/class/syntax-error-grammar-field-def-has-initializer-no-sc.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - x = [] -} diff --git a/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js deleted file mode 100644 index d4991c69f1..0000000000 --- a/test/language/statements/class/syntax-error-grammar-field-no-initializer-with-method.js +++ /dev/null @@ -1,32 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-no-initializer-with-method.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - x - m() {} -} diff --git a/test/language/statements/class/syntax-error-grammar-fields.js b/test/language/statements/class/syntax-error-grammar-fields.js deleted file mode 100644 index 7b0527c42f..0000000000 --- a/test/language/statements/class/syntax-error-grammar-fields.js +++ /dev/null @@ -1,31 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-fields.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template -/*--- -description: SyntaxError (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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - x y -} diff --git a/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js deleted file mode 100644 index 1014356e35..0000000000 --- a/test/language/statements/class/syntax-error-grammar-privatename-no-initializer-with-method.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-no-initializer-with-method.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - #x - m() {} -} diff --git a/test/language/statements/class/syntax-error-grammar-privatename.js b/test/language/statements/class/syntax-error-grammar-privatename.js deleted file mode 100644 index e92dadf3ac..0000000000 --- a/test/language/statements/class/syntax-error-grammar-privatename.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - # x -} diff --git a/test/language/statements/class/syntax-error-grammar-privatenames.js b/test/language/statements/class/syntax-error-grammar-privatenames.js deleted file mode 100644 index 503031c6bd..0000000000 --- a/test/language/statements/class/syntax-error-grammar-privatenames.js +++ /dev/null @@ -1,34 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatenames.case -// - src/class-fields/syntax/invalid/cls-decl-fields-invalid-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - #x #y -} diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js index f0a7779408..80c3f60e82 100644 --- a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-ues-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-ues-error.case // - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js index 5bc7632b4d..dfc24344fd 100644 --- a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwj-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-zwj-error.case // - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js index 638f1ca522..13c9558d65 100644 --- a/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-field-identifier-invalid-zwnj-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-field-identifier-invalid-zwnj-error.case // - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template /*--- -description: Valid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) +description: Invalid FieldDefinition, ClassElementName, PropertyName Syntax (class declaration) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] @@ -41,12 +41,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js index 7ddf739086..e7393680a5 100644 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-error.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-privatename-error.case // - src/class-fields/syntax/invalid/cls-decl-fields-invalid-syntax.template /*--- -description: SyntaxError (class declaration) +description: No space allowed between sigial and IdentifierName (class declaration) esid: prod-ClassElement features: [class-fields-private, class] flags: [generated] @@ -24,7 +24,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js index 95e59adab0..03f54da912 100644 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-ues.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js index 052e5c8493..5f707a61b4 100644 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwj-error.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js index accdca3be8..6d56613aed 100644 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-invalid-zwnj-error.js @@ -24,23 +24,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js deleted file mode 100644 index 01562653b4..0000000000 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-id-start-error.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-identifier-non-id-start-error.case -// - src/class-fields/syntax/invalid/cls-decl-fields-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 - - - 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". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - #\u{00}; -} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js b/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js deleted file mode 100644 index 5dfa380f04..0000000000 --- a/test/language/statements/class/syntax-invalid-grammar-privatename-identifier-non-ues-error.js +++ /dev/null @@ -1,65 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-privatename-identifier-non-ues-error.case -// - src/class-fields/syntax/invalid/cls-decl-fields-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 - - - 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". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - #\u0000; -} diff --git a/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js index c76d611923..b85fab1969 100644 --- a/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js +++ b/test/language/statements/class/syntax-invalid-grammar-privatenames-same-line-error.js @@ -24,7 +24,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js index dc2cccaed3..437af898dc 100644 --- a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer-alt.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js index 843cd646de..04b8fc12d9 100644 --- a/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js +++ b/test/language/statements/class/syntax-valid-grammar-field-classelementname-initializer.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js index 23bc067205..fdbab337df 100644 --- a/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier-alt.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-valid-grammar-field-identifier.js b/test/language/statements/class/syntax-valid-grammar-field-identifier.js index 6100975d82..f7ec447dbb 100644 --- a/test/language/statements/class/syntax-valid-grammar-field-identifier.js +++ b/test/language/statements/class/syntax-valid-grammar-field-identifier.js @@ -38,12 +38,12 @@ info: | UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart :: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart :: diff --git a/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js index cb260398d5..61717ccc7e 100644 --- a/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js +++ b/test/language/statements/class/syntax-valid-grammar-fields-multi-line.js @@ -2,7 +2,7 @@ // - src/class-fields/grammar-fields-multi-line.case // - src/class-fields/syntax/valid/cls-decl-fields-valid-syntax.template /*--- -description: SyntaxError (class declaration) +description: Valid multi-line, multi-field (class declaration) esid: prod-ClassElement features: [class-fields-public, class] flags: [generated] diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js index 76f969b204..221df0069c 100644 --- a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer-alt.js @@ -21,26 +21,26 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName Initializer : = AssignmentExpression - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js index 3f97f1e0a3..4c0e2d3b99 100644 --- a/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js +++ b/test/language/statements/class/syntax-valid-grammar-privatename-classelementname-initializer.js @@ -21,26 +21,26 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName Initializer : = AssignmentExpression - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js index dfe6c3703c..39ba28c386 100644 --- a/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js +++ b/test/language/statements/class/syntax-valid-grammar-privatename-identifier.js @@ -21,23 +21,23 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName - IdentifierName:: + IdentifierName :: IdentifierStart IdentifierName IdentifierPart - IdentifierStart:: + IdentifierStart :: UnicodeIDStart $ _ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence IdentifierPart:: UnicodeIDContinue $ - \UnicodeEscapeSequence + \ UnicodeEscapeSequence UnicodeIDStart:: diff --git a/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js index 93b9728f6c..0c00168f84 100644 --- a/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js +++ b/test/language/statements/class/syntax-valid-grammar-privatename-no-initializer-with-method.js @@ -21,7 +21,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ diff --git a/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js index 0bef1fab1a..816f519ee6 100644 --- a/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js +++ b/test/language/statements/class/syntax-valid-grammar-privatenames-multi-line.js @@ -21,7 +21,7 @@ info: | PropertyName PrivateName - PrivateName:: + PrivateName :: # IdentifierName ---*/ From a5505bbf2001669167742ea870f8d1409f7b30e7 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 12:15:23 -0400 Subject: [PATCH 25/40] Address feedback from PR review - needs to use async* to declare async generator methods. - Needs to use yield* if delegating yield semantics are intended. - Has assignment to private name method, which is not allowed and throws a TypeError at runtime. - handle multiple $DONE calls - fix calls to private methods --- ...ls-decl-after-same-line-async-gen.template | 14 +++- ...decl-after-same-line-async-method.template | 14 +++- ...-after-same-line-static-async-gen.template | 14 +++- ...ter-same-line-static-async-method.template | 14 +++- ...ls-expr-after-same-line-async-gen.template | 14 +++- ...expr-after-same-line-async-method.template | 14 +++- ...-after-same-line-static-async-gen.template | 14 +++- ...ter-same-line-static-async-method.template | 14 +++- ...tor-method-privatename-identifier-alt.case | 36 +++++----- ...nerator-method-privatename-identifier.case | 36 +++++----- ...tor-method-privatename-identifier-alt.case | 36 +++++----- ...nerator-method-privatename-identifier.case | 36 +++++----- .../static-private-methods-with-fields.case | 69 +++++++++++++++++++ src/class-fields/static-private-methods.case | 28 ++++---- 14 files changed, 249 insertions(+), 104 deletions(-) create mode 100644 src/class-fields/static-private-methods-with-fields.case diff --git a/src/class-fields/productions/cls-decl-after-same-line-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-async-gen.template index 86112b8c1b..f7eb3bd09e 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-async-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-async-gen.template @@ -26,9 +26,19 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-decl-after-same-line-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-async-method.template index 0c2e40f9c6..f0235f2968 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-async-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-async-method.template @@ -26,8 +26,18 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template index 5f2527b231..1f20b30cad 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template @@ -26,9 +26,19 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template index 78d5c7ad6f..15e7776024 100644 --- a/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +++ b/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template @@ -26,8 +26,18 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-expr-after-same-line-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template index ce74f1e488..9fbf8d3abb 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-async-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template @@ -26,9 +26,19 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-expr-after-same-line-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-async-method.template index 5159fb2431..8b7a65b884 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-async-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-async-method.template @@ -26,8 +26,18 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template index 0a1cb27869..f170891657 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template @@ -26,9 +26,19 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template index ff00a66a60..2cf8679f24 100644 --- a/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +++ b/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template @@ -26,8 +26,18 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -/*{ assertions }*/ - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + /*{ assertions }*/ + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case index 1b5473a9ab..d43fe887e2 100644 --- a/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case @@ -59,42 +59,42 @@ features: [class-static-methods-private] ---*/ //- fields -static async #$(value) { +static async * #$(value) { yield await value; } -static async #_(value) { +static async * #_(value) { yield await value; } -static async #o(value) { +static async * #o(value) { yield await value; } -static async #℘(value) { +static async * #℘(value) { yield await value; } -static async #ZW_‌_NJ(value) { +static async * #ZW_‌_NJ(value) { yield await value; } -static async #ZW_‍_J(value) { +static async * #ZW_‍_J(value) { yield await value; } //- privateinspectionfunctions -static async $(value) { - yield * await this.#$(value); +static get $() { + return this.#$; } -static async _(value) { - yield * await this.#_(value); +static get _() { + return this.#_; } -static async o(value) { - yield * await this.#o(value); +static get o() { + return this.#o; } -static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); +static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } -static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); +static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } -static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); +static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } //- assertions diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case index f29b16414e..7f299d5074 100644 --- a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case @@ -60,41 +60,41 @@ features: [class-static-methods-private] //- fields static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } //- privateinspectionfunctions -static async * $(value) { - yield * await this.#$(value); +static async * $() { + return this.#$; } -static async * _(value) { - yield * await this.#_(value); +static async * _() { + return this.#_; } -static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); +static async * \u{6F}() { + return this.#\u{6F}; } -static async * \u2118(value) { - yield * await this.#\u2118(value); +static async * \u2118() { + return this.#\u2118; } -static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); +static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } -static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); +static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } //- assertions diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case index 500426daba..9fe46136af 100644 --- a/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +++ b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case @@ -59,41 +59,41 @@ features: [class-static-methods-private] //- fields static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } //- privateinspectionfunctions -static * $(value) { - yield this.#$(value); +static get $() { + return this.#$; } -static * _(value) { - yield this.#_(value); +static get _() { + return this.#_; } -static * o(value) { - yield this.#o(value); +static get o() { + return this.#o; } -static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); +static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } -static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); +static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } -static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); +static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } //- assertions diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier.case b/src/class-fields/rs-static-generator-method-privatename-identifier.case index 0b7dd4558f..a263c82684 100644 --- a/src/class-fields/rs-static-generator-method-privatename-identifier.case +++ b/src/class-fields/rs-static-generator-method-privatename-identifier.case @@ -59,41 +59,41 @@ features: [class-static-methods-private] //- fields static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } //- privateinspectionfunctions -static * $(value) { - yield this.#$(value); +static get $() { + return this.#$; } -static * _(value) { - yield this.#_(value); +static get _() { + return this.#_; } -static * \u{6F}(value) { - yield this.#\u{6F}(value); +static get \u{6F}() { + return this.#\u{6F}; } -static * \u2118(value) { - yield this.#\u2118(value); +static get \u2118() { + return this.#\u2118; } -static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); +static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } -static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); +static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } //- assertions diff --git a/src/class-fields/static-private-methods-with-fields.case b/src/class-fields/static-private-methods-with-fields.case new file mode 100644 index 0000000000..6334a58c7d --- /dev/null +++ b/src/class-fields/static-private-methods-with-fields.case @@ -0,0 +1,69 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: static private methods with fields +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +template: productions +features: [class-static-methods-private, class-static-fields-private] +---*/ + +//- fields +static #xVal; static #yVal +//- privateinspectionfunctions +static #x(value) { + this.#xVal = value; + return this.#xVal; +} +static #y(value) { + this.#yVal = value; + return this.#yVal; +} +static x() { + return this.#x(42); +} +static y() { + return this.#y(43); +} +//- assertions + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/src/class-fields/static-private-methods.case b/src/class-fields/static-private-methods.case index 50b6565f24..9d86d6ac69 100644 --- a/src/class-fields/static-private-methods.case +++ b/src/class-fields/static-private-methods.case @@ -21,19 +21,15 @@ template: productions features: [class-static-methods-private] ---*/ -//- fields -static #xVal; static #yVal //- privateinspectionfunctions static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -41,18 +37,18 @@ static y() { //- assertions // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); From c5a1a4a24b0a8cb118c3580b40e474dcc9d96320 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:03:57 -0400 Subject: [PATCH 26/40] Generate tests --- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 83 ++++++++++++ ...er-same-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...same-line-method-static-private-methods.js | 28 ++--- ...me-line-static-async-gen-computed-names.js | 78 +++++++----- ...-static-async-gen-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ame-line-static-async-gen-literal-names.js | 72 ++++++----- ...ame-line-static-async-gen-private-names.js | 44 ++++--- ...ync-gen-rs-field-identifier-initializer.js | 24 ++-- ...ne-static-async-gen-rs-field-identifier.js | 38 +++--- ...async-gen-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...n-rs-privatename-identifier-initializer.js | 26 ++-- ...tic-async-gen-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...en-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...nc-gen-rs-static-privatename-identifier.js | 26 ++-- ...-static-async-gen-static-private-fields.js | 44 ++++--- ...-gen-static-private-methods-with-fields.js | 98 +++++++++++++++ ...static-async-gen-static-private-methods.js | 54 ++++---- ...e-static-async-gen-string-literal-names.js | 90 +++++++------ ...line-static-async-method-computed-names.js | 78 +++++++----- ...atic-async-method-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...-line-static-async-method-literal-names.js | 72 ++++++----- ...-line-static-async-method-private-names.js | 44 ++++--- ...-method-rs-field-identifier-initializer.js | 24 ++-- ...static-async-method-rs-field-identifier.js | 38 +++--- ...nc-method-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...d-rs-privatename-identifier-initializer.js | 26 ++-- ...-async-method-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...od-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...method-rs-static-privatename-identifier.js | 26 ++-- ...atic-async-method-static-private-fields.js | 44 ++++--- ...thod-static-private-methods-with-fields.js | 97 ++++++++++++++ ...tic-async-method-static-private-methods.js | 54 ++++---- ...tatic-async-method-string-literal-names.js | 90 +++++++------ ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 83 ++++++++++++ ...-line-static-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...ne-static-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 119 ++++++++++++++++++ ...iple-definitions-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 97 ++++++++++++++ ...cked-definitions-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 84 +++++++++++++ ...o-sc-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 85 +++++++++++++ ...-new-sc-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 84 +++++++++++++ ...w-sc-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 72 +++++++++++ ...ular-definitions-static-private-methods.js | 28 ++--- ...elds-same-line-async-gen-computed-names.js | 78 +++++++----- ...me-line-async-gen-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ields-same-line-async-gen-literal-names.js | 72 ++++++----- ...ields-same-line-async-gen-private-names.js | 44 ++++--- ...ync-gen-rs-field-identifier-initializer.js | 24 ++-- ...same-line-async-gen-rs-field-identifier.js | 38 +++--- ...async-gen-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...n-rs-privatename-identifier-initializer.js | 26 ++-- ...ine-async-gen-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...en-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...nc-gen-rs-static-privatename-identifier.js | 26 ++-- ...me-line-async-gen-static-private-fields.js | 44 ++++--- ...-gen-static-private-methods-with-fields.js | 98 +++++++++++++++ ...e-line-async-gen-static-private-methods.js | 54 ++++---- ...ame-line-async-gen-string-literal-names.js | 90 +++++++------ ...s-same-line-async-method-computed-names.js | 78 +++++++----- ...line-async-method-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ds-same-line-async-method-literal-names.js | 72 ++++++----- ...ds-same-line-async-method-private-names.js | 44 ++++--- ...-method-rs-field-identifier-initializer.js | 24 ++-- ...e-line-async-method-rs-field-identifier.js | 38 +++--- ...nc-method-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...d-rs-privatename-identifier-initializer.js | 26 ++-- ...-async-method-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...od-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...method-rs-static-privatename-identifier.js | 26 ++-- ...line-async-method-static-private-fields.js | 44 ++++--- ...thod-static-private-methods-with-fields.js | 97 ++++++++++++++ ...ine-async-method-static-private-methods.js | 54 ++++---- ...-line-async-method-string-literal-names.js | 90 +++++++------ ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 84 +++++++++++++ ...ds-same-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...same-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...n-sc-static-private-methods-with-fields.js | 74 +++++++++++ ...ds-wrapped-in-sc-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 83 ++++++++++++ ...er-same-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...same-line-method-static-private-methods.js | 28 ++--- ...me-line-static-async-gen-computed-names.js | 78 +++++++----- ...-static-async-gen-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ame-line-static-async-gen-literal-names.js | 72 ++++++----- ...ame-line-static-async-gen-private-names.js | 44 ++++--- ...ync-gen-rs-field-identifier-initializer.js | 24 ++-- ...ne-static-async-gen-rs-field-identifier.js | 38 +++--- ...async-gen-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...n-rs-privatename-identifier-initializer.js | 26 ++-- ...tic-async-gen-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...en-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...nc-gen-rs-static-privatename-identifier.js | 26 ++-- ...-static-async-gen-static-private-fields.js | 44 ++++--- ...-gen-static-private-methods-with-fields.js | 98 +++++++++++++++ ...static-async-gen-static-private-methods.js | 54 ++++---- ...e-static-async-gen-string-literal-names.js | 90 +++++++------ ...line-static-async-method-computed-names.js | 78 +++++++----- ...atic-async-method-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...-line-static-async-method-literal-names.js | 72 ++++++----- ...-line-static-async-method-private-names.js | 44 ++++--- ...-method-rs-field-identifier-initializer.js | 24 ++-- ...static-async-method-rs-field-identifier.js | 38 +++--- ...nc-method-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...d-rs-privatename-identifier-initializer.js | 26 ++-- ...-async-method-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...od-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...method-rs-static-privatename-identifier.js | 26 ++-- ...atic-async-method-static-private-fields.js | 44 ++++--- ...thod-static-private-methods-with-fields.js | 97 ++++++++++++++ ...tic-async-method-static-private-methods.js | 54 ++++---- ...tatic-async-method-string-literal-names.js | 90 +++++++------ ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 83 ++++++++++++ ...-line-static-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...ne-static-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 119 ++++++++++++++++++ ...iple-definitions-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 97 ++++++++++++++ ...cked-definitions-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 84 +++++++++++++ ...o-sc-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 85 +++++++++++++ ...-new-sc-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 84 +++++++++++++ ...w-sc-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...ions-static-private-methods-with-fields.js | 72 +++++++++++ ...ular-definitions-static-private-methods.js | 28 ++--- ...elds-same-line-async-gen-computed-names.js | 78 +++++++----- ...me-line-async-gen-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ields-same-line-async-gen-literal-names.js | 72 ++++++----- ...ields-same-line-async-gen-private-names.js | 44 ++++--- ...ync-gen-rs-field-identifier-initializer.js | 24 ++-- ...same-line-async-gen-rs-field-identifier.js | 38 +++--- ...async-gen-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...n-rs-privatename-identifier-initializer.js | 26 ++-- ...ine-async-gen-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...en-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...nc-gen-rs-static-privatename-identifier.js | 26 ++-- ...me-line-async-gen-static-private-fields.js | 44 ++++--- ...-gen-static-private-methods-with-fields.js | 98 +++++++++++++++ ...e-line-async-gen-static-private-methods.js | 54 ++++---- ...ame-line-async-gen-string-literal-names.js | 90 +++++++------ ...s-same-line-async-method-computed-names.js | 78 +++++++----- ...line-async-method-computed-symbol-names.js | 66 +++++----- ...tename-identifier-semantics-stringvalue.js | 20 ++- ...ds-same-line-async-method-literal-names.js | 72 ++++++----- ...ds-same-line-async-method-private-names.js | 44 ++++--- ...-method-rs-field-identifier-initializer.js | 24 ++-- ...e-line-async-method-rs-field-identifier.js | 38 +++--- ...nc-method-rs-privatename-identifier-alt.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...d-rs-privatename-identifier-initializer.js | 26 ++-- ...-async-method-rs-privatename-identifier.js | 26 ++-- ...rator-method-privatename-identifier-alt.js | 82 ++++++------ ...generator-method-privatename-identifier.js | 84 +++++++------ ...async-method-privatename-identifier-alt.js | 46 ++++--- ...tic-async-method-privatename-identifier.js | 48 ++++--- ...rator-method-privatename-identifier-alt.js | 60 +++++---- ...generator-method-privatename-identifier.js | 62 +++++---- ...tatic-method-privatename-identifier-alt.js | 26 ++-- ...rs-static-method-privatename-identifier.js | 26 ++-- ...privatename-identifier-alt-by-classname.js | 26 ++-- ...od-rs-static-privatename-identifier-alt.js | 26 ++-- ...tic-privatename-identifier-by-classname.js | 26 ++-- ...identifier-initializer-alt-by-classname.js | 26 ++-- ...-privatename-identifier-initializer-alt.js | 26 ++-- ...atic-privatename-identifier-initializer.js | 26 ++-- ...method-rs-static-privatename-identifier.js | 26 ++-- ...line-async-method-static-private-fields.js | 44 ++++--- ...thod-static-private-methods-with-fields.js | 97 ++++++++++++++ ...ine-async-method-static-private-methods.js | 54 ++++---- ...-line-async-method-string-literal-names.js | 90 +++++++------ ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...-gen-static-private-methods-with-fields.js | 84 +++++++++++++ ...ds-same-line-gen-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...thod-static-private-methods-with-fields.js | 83 ++++++++++++ ...same-line-method-static-private-methods.js | 28 ++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...rator-method-privatename-identifier-alt.js | 36 +++--- ...generator-method-privatename-identifier.js | 36 +++--- ...n-sc-static-private-methods-with-fields.js | 74 +++++++++++ ...ds-wrapped-in-sc-static-private-methods.js | 28 ++--- 396 files changed, 11370 insertions(+), 6110 deletions(-) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-regular-definitions-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-same-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-same-line-method-static-private-methods-with-fields.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-multiple-definitions-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-regular-definitions-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-same-line-async-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-same-line-gen-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-same-line-method-static-private-methods-with-fields.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-static-private-methods-with-fields.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index fc911d0320..b4820018ae 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - *m() { return 42; } static async #$(value) { + *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 3963332d19..69981853c9 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index b476ac548a..ff21ef06f3 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js index 04f3dda18f..8206125d7d 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..e71673d907 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: static private methods with fields (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js index a7b69d61cc..9639fd2f99 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - *m() { return 42; } static #xVal; static #yVal; + *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 252484c0ad..9f06a4102a 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - m() { return 42; } static async #$(value) { + m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index e21b8a4dd5..f5d7e71e45 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index fa9c6081c5..e9e52f25ac 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js index fd80b63356..dc0d84ce97 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..17159d7df5 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: static private methods with fields (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js index a45087347c..cd5594950d 100644 --- a/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - m() { return 42; } static #xVal; static #yVal; + m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js index 4f92e5bc9f..bfb1108860 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js @@ -39,41 +39,51 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js index 80d36a6128..901648f55d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -40,35 +40,45 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index ec7fbec04c..a9e56846d0 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,12 +98,22 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js index b298c5f633..76a72a7f91 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js @@ -40,38 +40,48 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js index 8a73040702..ed92d09c0f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-private-names.js @@ -47,24 +47,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js index 87bb10775f..fa307baf5c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -74,14 +74,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js index cdf3f000f7..dc4bf4b226 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -74,21 +74,31 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js index bf0b03b253..5036153f12 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -95,15 +95,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js index 718948e078..d3d5c4c489 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -89,15 +89,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js index 9a45f465ed..102070c8ee 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -89,15 +89,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js index f1693b695e..c0d8ba7d1e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -95,15 +95,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 84e248f8a4..7cf2aac622 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static async *m() { return 42; } static async #$(value) { + static async *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index fa4f68e1b7..1fea76cae8 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,26 +111,36 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js index cd4791232b..da8fe5611f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js index d4209a9fd3..2a00f8ca72 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js @@ -111,26 +111,36 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js index 9872898804..31b3575d57 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,14 +111,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js index cca95d074c..fdc6e94eca 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,15 +111,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js index 8c1b3ec4ae..9a35ca9679 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -108,15 +108,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js index 3367d390f4..a2591243a5 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -108,15 +108,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js index 41b6ead3f0..9b71691e31 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js index fae74f1829..73a514b15d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js index a646301450..d8f41b3aa6 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js index 09fce36734..807418f83c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js index c35ef2e3ca..62af4c1635 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js index b3bae16d27..c6f01fda88 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js index c898059164..38d8ff2094 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js index 8f27dd8736..96ff7d881c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-fields.js @@ -47,24 +47,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..4e6610b25e --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js @@ -0,0 +1,98 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: static private methods with fields (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js index d8e030b0d5..20f8d7aa0e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static async *m() { return 42; } static #xVal; static #yVal; + static async *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,24 +51,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js index 95e1a46432..ce1018ae6f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -38,47 +38,57 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js index b32ed9b83f..e0938c4544 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-names.js @@ -39,40 +39,50 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js index 392fb7b0a6..04091e6e96 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -40,34 +40,44 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js index 5e932402ae..e5426eef12 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,11 +98,21 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js index 14f723d1dd..166d40d02f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names.js @@ -40,37 +40,47 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js index 2dfe19655f..4a04280937 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-private-names.js @@ -47,23 +47,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js index cc3a4aef07..6a1590440a 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -74,13 +74,23 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js index 6a6270a478..ee7569bd93 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -74,20 +74,30 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js index df53d38f99..6b4d954e86 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -95,14 +95,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js index 950a23d17a..7a48df1b60 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -89,14 +89,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js index 2a734e15f6..c90bd5319b 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -89,14 +89,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js index 2aeb93b8c8..7fb854b73c 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -95,14 +95,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index a1ebbc4c7a..6df986a9ca 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static async m() { return 42; } static async #$(value) { + static async m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,24 +111,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index f062838678..3a88a620fb 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js index 3d80577fa5..8d834ca550 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -111,24 +111,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js index 842b65e3b8..db2e674beb 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js index 02ed350661..d11fcb72c7 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,13 +111,23 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js index 194dc3d999..d54a82407f 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,14 +111,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js index 018063c0e9..fd52de3d25 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -108,14 +108,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js index a0124ed6dc..2bbc3368ee 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -108,14 +108,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js index d121c08459..855072f5ed 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js index bb4679d89f..bc80961b63 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js index 1460024a08..dcb3d360d5 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js index f1ce0e6a3b..01b88952ff 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js index 741cc639d6..6d7d7a39c8 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js index ee6fedcc0d..1a04620757 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js index ee079a906d..1fe7145228 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js index 21a43260e1..f5ffc73db5 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-fields.js @@ -47,23 +47,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..9b6bbb6ce0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: static private methods with fields (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js index 3a61adf3ff..a6bec3eb49 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static async m() { return 42; } static #xVal; static #yVal; + static async m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,23 +51,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js index 9d0422cbdc..d9f7af8b18 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -38,46 +38,56 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 7ed3135c5e..ce4adc3b88 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static *m() { return 42; } static async #$(value) { + static *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index 6f0571f81c..06356c8527 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js index 67e21fb3f7..fa18e79e92 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js index fd57c93431..f7307965b2 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..387d134558 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: static private methods with fields (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js index b7e9ca1ae2..b23414123b 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static *m() { return 42; } static #xVal; static #yVal; + static *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js index 8b81ed9948..72fd281cbf 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static m() { return 42; } static async #$(value) { + static m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index dba6451cf2..08ac599fc1 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js index 8ea5bb1746..c6d12d3884 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js index f1ce1992d4..4233c9282d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..39c4a87e38 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: static private methods with fields (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js index 8cb2832729..d79182d748 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static m() { return 42; } static #xVal; static #yVal; + static m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 5ccf01a63f..2d1c0a1057 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -63,43 +63,43 @@ info: | var C = class { foo = "foobar"; m() { return 42 } - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } m2() { return 39 } bar = "barbaz"; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index 4e45cd1f00..60c154bcfc 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -64,42 +64,42 @@ var C = class { foo = "foobar"; m() { return 42 } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } m2() { return 39 } bar = "barbaz"; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js index b72e78cfb0..ca6a339d7c 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -64,42 +64,42 @@ var C = class { foo = "foobar"; m() { return 42 } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } m2() { return 39 } bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js index 4aa37a2528..020842fa4c 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -64,42 +64,42 @@ var C = class { foo = "foobar"; m() { return 42 } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } m2() { return 39 } bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-methods-with-fields.js b/test/language/expressions/class/fields-multiple-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..effd613865 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-methods-with-fields.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: static private methods with fields (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + static #xVal; static #yVal + m2() { return 39 } + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js b/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js index dec012b261..073971189b 100644 --- a/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-methods.js @@ -27,19 +27,17 @@ info: | var C = class { foo = "foobar"; m() { return 42 } - static #xVal; static #yVal + m2() { return 39 } bar = "barbaz"; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -91,18 +89,18 @@ verifyProperty(c, "bar", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 779ab2384b..5eb792a6bf 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,43 +61,43 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } foo = "foobar" bar = "barbaz"; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index 8960c89dfb..ff89ffcfd8 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -62,42 +62,42 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } foo = "foobar" bar = "barbaz"; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js index 4840c98d97..7f8e83b6c0 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -62,42 +62,42 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } foo = "foobar" bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js index d1ef00fc02..9400b141e6 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -62,42 +62,42 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } foo = "foobar" bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..ff6b10b567 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: static private methods with fields (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + foo = "foobar" + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js index 85791c2060..72f98a2383 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-methods.js @@ -25,19 +25,17 @@ info: | var C = class { - static #xVal; static #yVal + foo = "foobar" bar = "barbaz"; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -69,18 +67,18 @@ verifyProperty(c, "bar", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 042ffc2567..5199118527 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 76a4c887ec..ddbdd56fe2 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index 33950f9664..3fb1465028 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js index ada54f0158..6f689fd462 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..00856fe625 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js index 5c41cadc9a..7c57006363 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-methods.js @@ -25,18 +25,16 @@ info: | var C = class { - static #xVal; static #yVal + m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index c4b9e37137..2feaf8acde 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; *m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index 941da6fcbf..fee12a971c 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js index d7a6c8ef22..5de6b1771b 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js index 154156c8e6..4829ffee53 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..d6ec72256e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,85 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; + *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js index 525cb72141..42dfb674ce 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-private-methods.js @@ -25,18 +25,16 @@ info: | var C = class { - static #xVal; static #yVal; + ; *m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 89265d3fc2..3da00f169a 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 616f3a3f7a..4566198a9d 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index d3ec9ff36e..dd76e7f092 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js index ad929a09c7..21dd9fda45 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..0e2c4a2976 --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js index 4074913bf3..6352a38fbf 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js +++ b/test/language/expressions/class/fields-new-sc-line-method-static-private-methods.js @@ -25,18 +25,16 @@ info: | var C = class { - static #xVal; static #yVal; + ; m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index d656a76097..eb3667958e 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -60,41 +60,41 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 6ee58c844c..6ed93f3153 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -61,40 +61,40 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js index 6dc6cf0c17..cd41048da9 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -61,40 +61,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js index d5a380ed39..0c8c0ef053 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -61,40 +61,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-regular-definitions-static-private-methods-with-fields.js b/test/language/expressions/class/fields-regular-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..5014d5a16c --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-static-private-methods-with-fields.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: static private methods with fields (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-regular-definitions-static-private-methods.js b/test/language/expressions/class/fields-regular-definitions-static-private-methods.js index e1ef400f13..6e8a5312b9 100644 --- a/test/language/expressions/class/fields-regular-definitions-static-private-methods.js +++ b/test/language/expressions/class/fields-regular-definitions-static-private-methods.js @@ -24,17 +24,15 @@ info: | var C = class { - static #xVal; static #yVal + static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -44,18 +42,18 @@ var C = class { var c = new C(); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js index 7f8d920fec..348fbf9798 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-names.js @@ -39,41 +39,51 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js index a8d955ec20..dcbd8b973f 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js @@ -40,35 +40,45 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index b748989fa0..0545679928 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,12 +98,22 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js index 861efccce1..8e727897ac 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-literal-names.js @@ -40,38 +40,48 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-private-names.js b/test/language/expressions/class/fields-same-line-async-gen-private-names.js index 05ddab3fe4..dc2c8f8f7c 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-private-names.js @@ -47,24 +47,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js index 19577f96c5..481ae0f9e4 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -74,14 +74,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js index 998d5833e2..0d541830d8 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-field-identifier.js @@ -74,21 +74,31 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js index 7c5a1ade62..51a25b6add 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -95,15 +95,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js index 0414c25392..846a3ebf41 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -89,15 +89,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js index 26e2bbeb28..742906c892 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -89,15 +89,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js index db34f0e027..16deb05d5c 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -95,15 +95,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 60267b241e..5858b16d65 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - async *m() { return 42; } static async #$(value) { + async *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index f43c71c90b..b15158abc9 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,26 +111,36 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js index c49fe30888..360aedabc3 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js index 5a04dc9dd4..df4afec816 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js @@ -111,26 +111,36 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js index a2735fc801..0d367c08f1 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,14 +111,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js index 3d4332e3cb..00758cd361 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,15 +111,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js index f996692565..4fe3d61879 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -108,15 +108,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js index f412f24f64..744a6314b4 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -108,15 +108,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js index 4a67be1fdd..62b242c0b2 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js index 5bbb93a64f..26509ce6ce 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js index 1ee0e6c603..5b10ecd98d 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js index 0fcad31030..9ac4140759 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js index 7c61c13b20..063799717f 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js index 8fec6d6252..4e73cf6130 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js index ef41a0853a..faf913c0aa 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js index 40d189e4db..8d3c3eecfb 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-fields.js @@ -47,24 +47,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..b54546d135 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods-with-fields.js @@ -0,0 +1,98 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: static private methods with fields (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js index 2bbac54e1b..f70b80a505 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - async *m() { return 42; } static #xVal; static #yVal; + async *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,24 +51,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js index 108d2cf8f1..a843f8cabb 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-string-literal-names.js @@ -38,47 +38,57 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-computed-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-names.js index c358d94b9b..a57afbd307 100644 --- a/test/language/expressions/class/fields-same-line-async-method-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-computed-names.js @@ -39,40 +39,50 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js index b211484c3b..55c28114a7 100644 --- a/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-computed-symbol-names.js @@ -40,34 +40,44 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js index dc9750b233..8edf845943 100644 --- a/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/expressions/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,11 +98,21 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-literal-names.js index b4dbeb9bc4..4923ef63f4 100644 --- a/test/language/expressions/class/fields-same-line-async-method-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-literal-names.js @@ -40,37 +40,47 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-private-names.js b/test/language/expressions/class/fields-same-line-async-method-private-names.js index dab4667908..aa67b1faf9 100644 --- a/test/language/expressions/class/fields-same-line-async-method-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-private-names.js @@ -47,23 +47,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js index 7492d169e4..56dd742b10 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -74,13 +74,23 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js index 418b6bb5cb..d338ef06b7 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-field-identifier.js @@ -74,20 +74,30 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js index 5f99dd5ece..a93dd1dace 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -95,14 +95,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js index 2ad6e564e1..c611f6abb8 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -89,14 +89,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js index 43367d150e..7bd37f635b 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -89,14 +89,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js index 3ec6a7ceb2..8be0a72eff 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -95,14 +95,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 26bf78ab93..f2d7070a42 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - async m() { return 42; } static async #$(value) { + async m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,24 +111,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index e5122fd210..b7e573ad48 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js index 7a831c45c6..51560cd3ce 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -111,24 +111,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js index 8a32100ecc..7612ed4cb3 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js index 54ebe240d2..cf0352f99b 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,13 +111,23 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js index cf3e86f543..485d37f1d6 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,14 +111,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js index fc0ec082b3..36beb62fd0 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -108,14 +108,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js index bfeede6da5..ac2f83f229 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -108,14 +108,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js index bc9f3384d3..4cfdf2fbd3 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js index 3fe7bf6f27..66e5920a2a 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js index db6376c81f..e1801401fc 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js index 2a6168162d..206001ef52 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js index c5c15676b3..5149c0353c 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js index b372055420..193d57da26 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js index ca85618524..da93e94361 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js b/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js index 2370de7b56..d942db06c9 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-fields.js @@ -47,23 +47,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-same-line-async-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..700484810f --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: static private methods with fields (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js b/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js index fadd09677c..af8f5b912c 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - async m() { return 42; } static #xVal; static #yVal; + async m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,23 +51,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js index a311fd7c94..73f67f4a9a 100644 --- a/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-string-literal-names.js @@ -38,46 +38,56 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 66d0cc40fd..c0f6451faf 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; *m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index beb17a4454..5c42a9ecee 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index ca5a52108f..a6b44f4160 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js index ca34befd92..34ea16384f 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-methods-with-fields.js b/test/language/expressions/class/fields-same-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..4c713a5023 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: static private methods with fields (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-methods.js b/test/language/expressions/class/fields-same-line-gen-static-private-methods.js index d659b01a94..4ef5906965 100644 --- a/test/language/expressions/class/fields-same-line-gen-static-private-methods.js +++ b/test/language/expressions/class/fields-same-line-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static #xVal; static #yVal; *m() { return 42; } + ; *m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 8bd431c404..7a6d2a9308 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | var C = class { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index ef3c0c7ad4..bd54b46961 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index 3cc1e09920..2dc77c4d4a 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js index 5dfeb484e6..1772d74c12 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | var C = class { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-same-line-method-static-private-methods-with-fields.js b/test/language/expressions/class/fields-same-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..a694c74b4a --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + static #xVal; static #yVal; m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-same-line-method-static-private-methods.js b/test/language/expressions/class/fields-same-line-method-static-private-methods.js index a1c0c40cd5..86046ecb28 100644 --- a/test/language/expressions/class/fields-same-line-method-static-private-methods.js +++ b/test/language/expressions/class/fields-same-line-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | var C = class { - static #xVal; static #yVal; m() { return 42; } + ; m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js index 826c112aa8..f91bf29fbf 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | var C = class { ;;;; - ;;;;;;static async #$(value) { + ;;;;;;static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; };;;;;;; ;;;; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index 57027d8e82..55fecc3a8d 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { ;;;; ;;;;;;static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; };;;;;;; ;;;; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js index d4c4195bb9..234b1969af 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | var C = class { ;;;; ;;;;;;static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; };;;;;;; ;;;; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js index 4331108e29..71fb389cf8 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | var C = class { ;;;; ;;;;;;static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; };;;;;;; ;;;; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods-with-fields.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods-with-fields.js new file mode 100644 index 0000000000..8ff337d331 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods-with-fields.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: static private methods with fields (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +var C = class { + ;;;; + ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js index 32636c420d..5dc4b0a3ac 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-private-methods.js @@ -25,18 +25,16 @@ info: | var C = class { ;;;; - ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;;;;;;;;;;; ;;;; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -46,18 +44,18 @@ var C = class { var c = new C(); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 9371edf280..14a21f7e65 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - *m() { return 42; } static async #$(value) { + *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 530f0feddb..6d5be48070 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 7f9fdda341..580b11ce44 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js index 0cefd9ca02..9e66159934 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..f23a67eecf --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: static private methods with fields (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js index 00ed8463be..07a8b44bc0 100644 --- a/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - *m() { return 42; } static #xVal; static #yVal; + *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 314c7a6157..395e1098bf 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - m() { return 42; } static async #$(value) { + m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index fcf17e7581..4d2481015e 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index 1ff8aa7651..4c0db20b25 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js index f0fd6fe03d..cc30c68602 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..022da1efd2 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: static private methods with fields (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-method-static-private-methods.js index afdbfc13c6..1d6cba4280 100644 --- a/test/language/statements/class/fields-after-same-line-method-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - m() { return 42; } static #xVal; static #yVal; + m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js index f6d8311611..ee272af5c2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-names.js @@ -39,41 +39,51 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js index 6d538d492d..dcbb623ebf 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js @@ -40,35 +40,45 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index 4193fd5db7..bd780916cc 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,12 +98,22 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js index d6dea1573b..23533d37d0 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names.js @@ -40,38 +40,48 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js index 3262f4498c..732c84c1b4 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-private-names.js @@ -47,24 +47,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js index c0d859ba0d..40616dda77 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier-initializer.js @@ -74,14 +74,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js index 84fe450313..eb6b0dd387 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-field-identifier.js @@ -74,21 +74,31 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js index 545545a679..b3bad0c17d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-alt.js @@ -95,15 +95,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js index 3e40782756..7b6b59504b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer-alt.js @@ -89,15 +89,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js index 0bae129936..8f69917d79 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier-initializer.js @@ -89,15 +89,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js index ae07249fe7..6b7dff8d51 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-privatename-identifier.js @@ -95,15 +95,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 69a1935680..929ab0f215 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static async *m() { return 42; } static async #$(value) { + static async *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index 34953644e6..cac96c4d83 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,26 +111,36 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js index 894787f2c8..c9b7092ed7 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js index b99a59d829..f3be22f3ad 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-method-privatename-identifier.js @@ -111,26 +111,36 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js index efb94dcd9f..c3c9c958c3 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,14 +111,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js index e7b11c3084..b8a0a51ea6 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,15 +111,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js index 2f1ced3434..4f9f46333f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier-alt.js @@ -108,15 +108,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js index 9bd6795357..cd6c967e8d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-method-privatename-identifier.js @@ -108,15 +108,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js index e0c1b6eac9..45f75f47df 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js index 74f43bce35..a1caab2926 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-alt.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js index 27fc914429..c06b603e54 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js index caeb85e57e..2efd42533b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js index 5e596a3b25..2be74590f1 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js index b1ae4c245b..58aea799e8 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier-initializer.js @@ -90,15 +90,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js index 1859796b85..112aa8349a 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-privatename-identifier.js @@ -96,15 +96,25 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js index 2e337619da..9fb60f084c 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-fields.js @@ -47,24 +47,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..299d20e566 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods-with-fields.js @@ -0,0 +1,98 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: static private methods with fields (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js index fb473a75a7..b85c107081 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static async *m() { return 42; } static #xVal; static #yVal; + static async *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,24 +51,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js index 6b8d8536d3..54f379f589 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js @@ -38,47 +38,57 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - C.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js index e628b3ac56..ac3c2270cf 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-names.js @@ -39,40 +39,50 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js index ebb19a426f..330995b9fc 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js @@ -40,34 +40,44 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js index e4b1f887e2..dd4e7b0778 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,11 +98,21 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js index 6593a6c52a..909e4787be 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names.js @@ -40,37 +40,47 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js index f37ea74df6..5562be772b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-private-names.js @@ -47,23 +47,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js index ccc54913a7..3c3a4e3a49 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier-initializer.js @@ -74,13 +74,23 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js index 2fbf002c49..f6af541db4 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-field-identifier.js @@ -74,20 +74,30 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js index eb06ab96dd..9b308dd2a1 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-alt.js @@ -95,14 +95,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js index 6ac29798eb..77d3e9e6f0 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer-alt.js @@ -89,14 +89,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js index 4a717a34d0..30c955d44d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier-initializer.js @@ -89,14 +89,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js index 456a141c7a..61f1349e4d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-privatename-identifier.js @@ -95,14 +95,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 2ae364efaf..423b2460d2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static async m() { return 42; } static async #$(value) { + static async m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,24 +111,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index 7a20229408..bc70b593d5 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js index cd55d42a01..7e15960948 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -111,24 +111,34 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js index 8723f43953..60781e46e3 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-method-privatename-identifier.js @@ -111,25 +111,35 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js index f8b8fbb120..b6e85b8bfc 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,13 +111,23 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js index eaa3d8e082..204363818c 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,14 +111,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js index a47214d972..db82dc2e67 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier-alt.js @@ -108,14 +108,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js index 5519040ed4..32f0f982b8 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-method-privatename-identifier.js @@ -108,14 +108,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js index 424a78f852..9caeb56475 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js index 8b3699533c..c7818f8c11 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-alt.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js index 7a9b92ba26..2ce91412d6 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js index 883090c625..5ccfeca611 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js index f290fda1c2..05261823de 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js index ea5be51cc4..fdf2aabb54 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier-initializer.js @@ -90,14 +90,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js index bbf4349800..7ec3da6d46 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-privatename-identifier.js @@ -96,14 +96,24 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js index e77b50da51..16407a7f3f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-fields.js @@ -47,23 +47,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..fe2388d05e --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: static private methods with fields (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js index 755b850bd1..43c40f9713 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static async m() { return 42; } static #xVal; static #yVal; + static async m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,23 +51,33 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js index 4ff9e092a8..17b011aea6 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js @@ -38,46 +38,56 @@ verifyProperty(C, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - C.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 400d167e2b..217d5681aa 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static *m() { return 42; } static async #$(value) { + static *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index 6880c808e9..04ab8befe4 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js index bf3f71dada..a4137a87fc 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js index e9ab085db6..3e0274bd1f 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..ccf91c4410 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: static private methods with fields (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js index 77a4f80c9a..cec611b5ff 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static *m() { return 42; } static #xVal; static #yVal; + static *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js index 2766d3c61e..ad5d3fee90 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static m() { return 42; } static async #$(value) { + static m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index aaaf0f82d5..20506e5884 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js index b8edca96f4..7d9a95c322 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js index eb84e88ae7..5379980cb3 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..35f6c681dc --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: static private methods with fields (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js index 8c13b7e74f..a091055b74 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js +++ b/test/language/statements/class/fields-after-same-line-static-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static m() { return 42; } static #xVal; static #yVal; + static m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 688ee936d3..baa3fefd44 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -63,43 +63,43 @@ info: | class C { foo = "foobar"; m() { return 42 } - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } m2() { return 39 } bar = "barbaz"; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index d124b7bb70..ee2add8863 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -64,42 +64,42 @@ class C { foo = "foobar"; m() { return 42 } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } m2() { return 39 } bar = "barbaz"; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js index b5dad58cf6..390e76a116 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -64,42 +64,42 @@ class C { foo = "foobar"; m() { return 42 } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } m2() { return 39 } bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js index 65606f3995..be8eaf19d7 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -64,42 +64,42 @@ class C { foo = "foobar"; m() { return 42 } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } m2() { return 39 } bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-methods-with-fields.js b/test/language/statements/class/fields-multiple-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..4676833aa8 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-static-private-methods-with-fields.js @@ -0,0 +1,119 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: static private methods with fields (multiple fields definitions) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + static #xVal; static #yVal + m2() { return 39 } + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-methods.js b/test/language/statements/class/fields-multiple-definitions-static-private-methods.js index df86d9893d..5e551cb57a 100644 --- a/test/language/statements/class/fields-multiple-definitions-static-private-methods.js +++ b/test/language/statements/class/fields-multiple-definitions-static-private-methods.js @@ -27,19 +27,17 @@ info: | class C { foo = "foobar"; m() { return 42 } - static #xVal; static #yVal + m2() { return 39 } bar = "barbaz"; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -91,18 +89,18 @@ verifyProperty(c, "bar", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 09ade3dbfc..b6731aa850 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,43 +61,43 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } foo = "foobar" bar = "barbaz"; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index 356fd53748..0e3a704d67 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -62,42 +62,42 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } foo = "foobar" bar = "barbaz"; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js index a12442c283..3f4f52a932 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -62,42 +62,42 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } foo = "foobar" bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js index 346e65cdcf..44be313327 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -62,42 +62,42 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } foo = "foobar" bar = "barbaz"; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..c6a64bcfc2 --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: static private methods with fields (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + foo = "foobar" + bar = "barbaz"; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js index 9e38dfbc91..9a0d29ae31 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-methods.js @@ -25,19 +25,17 @@ info: | class C { - static #xVal; static #yVal + foo = "foobar" bar = "barbaz"; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -69,18 +67,18 @@ verifyProperty(c, "bar", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 605fb4537e..8d3c741766 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 239d4919c1..a3a80442c1 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index 7239d18edc..0105dbdcd1 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js index bca48ba4d3..f8f665aaed 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..3ccbc23ba9 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js index 6b444eb326..5ab1222b9a 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-private-methods.js @@ -25,18 +25,16 @@ info: | class C { - static #xVal; static #yVal + m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index e078209aa4..7faf2d03b8 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; *m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index 12b2d42c5e..dce0673774 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js index c52d4f24fa..157c9c25d2 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js index 1f5549752a..5be0a510d7 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..1239f224f5 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,85 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; + *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js index c1bf2164e0..553f28223e 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js +++ b/test/language/statements/class/fields-new-sc-line-gen-static-private-methods.js @@ -25,18 +25,16 @@ info: | class C { - static #xVal; static #yVal; + ; *m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 3b129d8707..758b553478 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index deac127cb8..26faa8654c 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index 00afe0eeb1..f3affd4f37 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js index f1563bbf98..05daed590e 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-new-sc-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..8951d66b86 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; + m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js b/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js index eb7d9e137e..52fce5b9d7 100644 --- a/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js +++ b/test/language/statements/class/fields-new-sc-line-method-static-private-methods.js @@ -25,18 +25,16 @@ info: | class C { - static #xVal; static #yVal; + ; m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -56,18 +54,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 4ca3001048..816836e01d 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -60,41 +60,41 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 4d384515f0..33a5f10f93 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -61,40 +61,40 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js index 87235f63cb..7dc79244d8 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -61,40 +61,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js index f2444b4a57..259d0a31f7 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -61,40 +61,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-regular-definitions-static-private-methods-with-fields.js b/test/language/statements/class/fields-regular-definitions-static-private-methods-with-fields.js new file mode 100644 index 0000000000..680fb71fa3 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-static-private-methods-with-fields.js @@ -0,0 +1,72 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: static private methods with fields (regular fields defintion) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-regular-definitions-static-private-methods.js b/test/language/statements/class/fields-regular-definitions-static-private-methods.js index 74b7858c7b..801cca5c01 100644 --- a/test/language/statements/class/fields-regular-definitions-static-private-methods.js +++ b/test/language/statements/class/fields-regular-definitions-static-private-methods.js @@ -24,17 +24,15 @@ info: | class C { - static #xVal; static #yVal + static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -44,18 +42,18 @@ class C { var c = new C(); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-names.js index 9dd54fa739..31c39e343a 100644 --- a/test/language/statements/class/fields-same-line-async-gen-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-computed-names.js @@ -39,41 +39,51 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js index 948d23c827..6e0f597841 100644 --- a/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-computed-symbol-names.js @@ -40,35 +40,45 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js index 6bd67d046c..95cfd47b36 100644 --- a/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-async-gen-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,12 +98,22 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-literal-names.js index 4ca55d8d96..1c9c16471e 100644 --- a/test/language/statements/class/fields-same-line-async-gen-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-literal-names.js @@ -40,38 +40,48 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-private-names.js b/test/language/statements/class/fields-same-line-async-gen-private-names.js index adbd03e6c6..9738418584 100644 --- a/test/language/statements/class/fields-same-line-async-gen-private-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-private-names.js @@ -47,24 +47,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js index 6906aadfa1..2b070254b3 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier-initializer.js @@ -74,14 +74,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js index 8db7ab527c..78359bed27 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-field-identifier.js @@ -74,21 +74,31 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js index 316381c808..8e51e99117 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-alt.js @@ -95,15 +95,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js index a2d85fa476..147e348503 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer-alt.js @@ -89,15 +89,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js index 71ad00009a..62c45ace28 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier-initializer.js @@ -89,15 +89,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js index 992843e45c..d6ba67cd60 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-privatename-identifier.js @@ -95,15 +95,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 263742e08c..eee91de28f 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - async *m() { return 42; } static async #$(value) { + async *m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index c63da90036..5c5d6ef151 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,26 +111,36 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js index d5b17a2aa2..b50c4363db 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier-alt.js @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js index 448e95ffdf..88fcb8cead 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-method-privatename-identifier.js @@ -111,26 +111,36 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js index 8557f9e155..a9fdec76f6 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,14 +111,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js index 2310df37d4..182d6b5aa1 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { async *m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,15 +111,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js index 3a5dbc94e5..fc25be8434 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier-alt.js @@ -108,15 +108,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js index 34822c8641..6ae403902f 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-method-privatename-identifier.js @@ -108,15 +108,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js index ff06256006..efc03fdd69 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js index 5c9a05df8e..c4a7cfee57 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-alt.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js index 64fa0b3f17..668651c021 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-by-classname.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js index 832d2cfc79..5533fb009e 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js index 15d9c9b353..39da868e54 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer-alt.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js index c5b703caea..73110c59fe 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier-initializer.js @@ -90,15 +90,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js index 2c2149d586..1ef59ac397 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-privatename-identifier.js @@ -96,15 +96,25 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js b/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js index 25507fab39..7760041b8e 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-fields.js @@ -47,24 +47,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-same-line-async-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..a372971358 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-methods-with-fields.js @@ -0,0 +1,98 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: static private methods with fields (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async *m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js b/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js index 56dec2a2ee..e8a86da184 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - async *m() { return 42; } static #xVal; static #yVal; + async *m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,24 +51,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js index 759eb62bd1..fa049206fd 100644 --- a/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-string-literal-names.js @@ -38,47 +38,57 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - c.m().next().then(function(v) { assert.sameValue(v.value, 42); assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-computed-names.js b/test/language/statements/class/fields-same-line-async-method-computed-names.js index f68257e2a0..63765da652 100644 --- a/test/language/statements/class/fields-same-line-async-method-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-method-computed-names.js @@ -39,40 +39,50 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); - -verifyProperty(c, "10", { - value: "meep", - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); - -verifyProperty(c, "not initialized", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "10"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "10"), false); + + verifyProperty(c, "10", { + value: "meep", + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); + + verifyProperty(c, "not initialized", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js index 11eda8bd65..1769248f7b 100644 --- a/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-method-computed-symbol-names.js @@ -40,34 +40,44 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(C, x), false); - -verifyProperty(c, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(C, y), false); - -verifyProperty(c, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); + assert.sameValue(Object.hasOwnProperty.call(C, x), false); + + verifyProperty(c, x, { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + assert.sameValue(Object.hasOwnProperty.call(C, y), false); + + verifyProperty(c, y, { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js index b1a083f770..3a37d59e2a 100644 --- a/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js +++ b/test/language/statements/class/fields-same-line-async-method-grammar-privatename-identifier-semantics-stringvalue.js @@ -98,11 +98,21 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.o(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.o(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-literal-names.js b/test/language/statements/class/fields-same-line-async-method-literal-names.js index a479fdd3c3..87c14e1d95 100644 --- a/test/language/statements/class/fields-same-line-async-method-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-method-literal-names.js @@ -40,37 +40,47 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: fn, + enumerable: true, + writable: true, + configurable: true + }); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-private-names.js b/test/language/statements/class/fields-same-line-async-method-private-names.js index 9f58eb22d2..8d412af6c4 100644 --- a/test/language/statements/class/fields-same-line-async-method-private-names.js +++ b/test/language/statements/class/fields-same-line-async-method-private-names.js @@ -47,23 +47,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(c.x(), 42, "test 7"); -assert.sameValue(c.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(c.x(), 42, "test 7"); + assert.sameValue(c.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js index e1b07b248c..de1f6e360a 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier-initializer.js @@ -74,13 +74,23 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js index 9ab607ddbf..8b95cb7b07 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-field-identifier.js @@ -74,20 +74,30 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -c.$ = 1; -c._ = 1; -c.\u{6F} = 1; -c.\u2118 = 1; -c.ZW_\u200C_NJ = 1; -c.ZW_\u200D_J = 1; - -assert.sameValue(c.$, 1); -assert.sameValue(c._, 1); -assert.sameValue(c.\u{6F}, 1); -assert.sameValue(c.\u2118, 1); -assert.sameValue(c.ZW_\u200C_NJ, 1); -assert.sameValue(c.ZW_\u200D_J, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + c.$ = 1; + c._ = 1; + c.\u{6F} = 1; + c.\u2118 = 1; + c.ZW_\u200C_NJ = 1; + c.ZW_\u200D_J = 1; + + assert.sameValue(c.$, 1); + assert.sameValue(c._, 1); + assert.sameValue(c.\u{6F}, 1); + assert.sameValue(c.\u2118, 1); + assert.sameValue(c.ZW_\u200C_NJ, 1); + assert.sameValue(c.ZW_\u200D_J, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js index a0819035aa..e91deb5ad0 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-alt.js @@ -95,14 +95,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.℘(1), 1); -assert.sameValue(c.ZW_‌_NJ(1), 1); -assert.sameValue(c.ZW_‍_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.℘(1), 1); + assert.sameValue(c.ZW_‌_NJ(1), 1); + assert.sameValue(c.ZW_‍_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js index 79ade95804..162cbf1d4d 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer-alt.js @@ -89,14 +89,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.℘(), 1); -assert.sameValue(c.ZW_‌_NJ(), 1); -assert.sameValue(c.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.℘(), 1); + assert.sameValue(c.ZW_‌_NJ(), 1); + assert.sameValue(c.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js index 35db4d8d0a..f6807a62ec 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier-initializer.js @@ -89,14 +89,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(), 1); -assert.sameValue(c._(), 1); -assert.sameValue(c.\u{6F}(), 1); -assert.sameValue(c.\u2118(), 1); -assert.sameValue(c.ZW_\u200C_NJ(), 1); -assert.sameValue(c.ZW_\u200D_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(), 1); + assert.sameValue(c._(), 1); + assert.sameValue(c.\u{6F}(), 1); + assert.sameValue(c.\u2118(), 1); + assert.sameValue(c.ZW_\u200C_NJ(), 1); + assert.sameValue(c.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js index 0ff930c120..9b6602c4ba 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-privatename-identifier.js @@ -95,14 +95,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(c.$(1), 1); -assert.sameValue(c._(1), 1); -assert.sameValue(c.\u{6F}(1), 1); -assert.sameValue(c.\u2118(1), 1); -assert.sameValue(c.ZW_\u200C_NJ(1), 1); -assert.sameValue(c.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(c.$(1), 1); + assert.sameValue(c._(1), 1); + assert.sameValue(c.\u{6F}(1), 1); + assert.sameValue(c.\u2118(1), 1); + assert.sameValue(c.ZW_\u200C_NJ(1), 1); + assert.sameValue(c.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 1807d1e71c..9439312b16 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - async m() { return 42; } static async #$(value) { + async m() { return 42; } static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,24 +111,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.o(1).next(), + C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index 1d10947d30..1a445b93e9 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), -]).then(results => { - - assert.sameValue(results[0].value, 1); - assert.sameValue(results[1].value, 1); - assert.sameValue(results[2].value, 1); - assert.sameValue(results[3].value, 1); - assert.sameValue(results[4].value, 1); - assert.sameValue(results[5].value, 1); - -}, $DONE).then($DONE, $DONE); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1).next(), + C._(1).next(), + C.\u{6F}(1).next(), + C.\u2118(1).next(), + C.ZW_\u200C_NJ(1).next(), + C.ZW_\u200D_J(1).next(), + ]).then(results => { + + assert.sameValue(results[0].value, 1); + assert.sameValue(results[1].value, 1); + assert.sameValue(results[2].value, 1); + assert.sameValue(results[3].value, 1); + assert.sameValue(results[4].value, 1); + assert.sameValue(results[5].value, 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js index bf618bbd90..cde5632550 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier-alt.js @@ -111,24 +111,34 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.o(1), - C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.o(1), + C.℘(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ(1), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J(1), // DO NOT CHANGE THE NAME OF THIS FIELD + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js index 021a6ac3a5..0228f8aca8 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-method-privatename-identifier.js @@ -111,25 +111,35 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -Promise.all([ - C.$(1), - C._(1), - C.\u{6F}(1), - C.\u2118(1), - C.ZW_\u200C_NJ(1), - C.ZW_\u200D_J(1), -]).then(results => { - - assert.sameValue(results[0], 1); - assert.sameValue(results[1], 1); - assert.sameValue(results[2], 1); - assert.sameValue(results[3], 1); - assert.sameValue(results[4], 1); - assert.sameValue(results[5], 1); - -}, $DONE).then($DONE, $DONE); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + Promise.all([ + C.$(1), + C._(1), + C.\u{6F}(1), + C.\u2118(1), + C.ZW_\u200C_NJ(1), + C.ZW_\u200D_J(1), + ]).then(results => { + + assert.sameValue(results[0], 1); + assert.sameValue(results[1], 1); + assert.sameValue(results[2], 1); + assert.sameValue(results[3], 1); + assert.sameValue(results[4], 1); + assert.sameValue(results[5], 1); + + }, $DONE).then($DONE, $DONE); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js index f20de2c3e5..d5a59e4b6f 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } @@ -111,13 +111,23 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.o(1).next().value, 1); + assert.sameValue(C.℘(1).next().value, 1); + assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); + assert.sameValue(C.ZW_‍_J(1).next().value, 1); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js index f6815bb66a..d6121a144f 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { async m() { return 42; } static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } @@ -111,14 +111,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1).next().value, 1); + assert.sameValue(C._(1).next().value, 1); + assert.sameValue(C.\u{6F}(1).next().value, 1); + assert.sameValue(C.\u2118(1).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); + assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js index ce2eda176b..f28968fb80 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier-alt.js @@ -108,14 +108,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js index 2ab524d63c..3f2b28f821 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-method-privatename-identifier.js @@ -108,14 +108,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js index b24220655b..4e0dafefa2 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js index 582e865cd8..a1ab3858a9 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-alt.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.o(1), 1); -assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD -assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.o(1), 1); + assert.sameValue(C.℘(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js index f5b8fc84c5..ad18be8aeb 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-by-classname.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js index ea9823cf4b..20e06d2448 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt-by-classname.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js index ae9e7f7b81..49fa983335 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer-alt.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.℘(), 1); -assert.sameValue(C.ZW_‌_NJ(), 1); -assert.sameValue(C.ZW_‍_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.℘(), 1); + assert.sameValue(C.ZW_‌_NJ(), 1); + assert.sameValue(C.ZW_‍_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js index 69aa0a43fc..c93137d864 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier-initializer.js @@ -90,14 +90,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(), 1); -assert.sameValue(C._(), 1); -assert.sameValue(C.\u{6F}(), 1); -assert.sameValue(C.\u2118(), 1); -assert.sameValue(C.ZW_\u200C_NJ(), 1); -assert.sameValue(C.ZW_\u200D_J(), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(), 1); + assert.sameValue(C._(), 1); + assert.sameValue(C.\u{6F}(), 1); + assert.sameValue(C.\u2118(), 1); + assert.sameValue(C.ZW_\u200C_NJ(), 1); + assert.sameValue(C.ZW_\u200D_J(), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js index 0508e4fc0e..bcd31bb1cf 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-privatename-identifier.js @@ -96,14 +96,24 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(C.$(1), 1); -assert.sameValue(C._(1), 1); -assert.sameValue(C.\u{6F}(1), 1); -assert.sameValue(C.\u2118(1), 1); -assert.sameValue(C.ZW_\u200C_NJ(1), 1); -assert.sameValue(C.ZW_\u200D_J(1), 1); - - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(C.$(1), 1); + assert.sameValue(C._(1), 1); + assert.sameValue(C.\u{6F}(1), 1); + assert.sameValue(C.\u2118(1), 1); + assert.sameValue(C.ZW_\u200C_NJ(1), 1); + assert.sameValue(C.ZW_\u200D_J(1), 1); + + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-fields.js b/test/language/statements/class/fields-same-line-async-method-static-private-fields.js index 3530b98d0f..a6bfb96c85 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-private-fields.js +++ b/test/language/statements/class/fields-same-line-async-method-static-private-fields.js @@ -47,23 +47,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private fields do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 43, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-same-line-async-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..f068a5af2c --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-static-private-methods-with-fields.js @@ -0,0 +1,97 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: static private methods with fields (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + async m() { return 42; } static #xVal; static #yVal; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); + assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); + assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 13"); + assert.sameValue(C.y(), 43, "test 14"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + + assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); + assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-methods.js b/test/language/statements/class/fields-same-line-async-method-static-private-methods.js index 15a37aa86d..c267dd1415 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-private-methods.js +++ b/test/language/statements/class/fields-same-line-async-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - async m() { return 42; } static #xVal; static #yVal; + async m() { return 42; } ; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -53,23 +51,33 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -// Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + // Test the private methods do not appear as properties before set to value + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); + assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); + assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + + // Test if private fields can be sucessfully accessed and set to value + assert.sameValue(C.x(), 42, "test 7"); + assert.sameValue(C.y(), 86, "test 8"); + + // Test the private fields do not appear as properties before after set to value + assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); + assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-string-literal-names.js b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js index 31354912cc..394ca82c16 100644 --- a/test/language/statements/class/fields-same-line-async-method-string-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-method-string-literal-names.js @@ -38,46 +38,56 @@ verifyProperty(C.prototype, "m", { writable: true, }, {restore: true}); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); - -verifyProperty(c, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); - -verifyProperty(c, "c", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); - -verifyProperty(c, "d", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - c.m().then(function(v) { assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + + verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + + verifyProperty(c, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); }, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 34c52e35be..ddc2ffc41a 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; *m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index d1bf17f7d0..df02c740c9 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 96c7fd2324..098a3c41f3 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js index 7487f8a298..9fe818f02b 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; *m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-same-line-gen-static-private-methods-with-fields.js b/test/language/statements/class/fields-same-line-gen-static-private-methods-with-fields.js new file mode 100644 index 0000000000..d3ca921528 --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-static-private-methods-with-fields.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: static private methods with fields (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public, + generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; *m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-same-line-gen-static-private-methods.js b/test/language/statements/class/fields-same-line-gen-static-private-methods.js index a1c6037d4f..d07ba26d0d 100644 --- a/test/language/statements/class/fields-same-line-gen-static-private-methods.js +++ b/test/language/statements/class/fields-same-line-gen-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static #xVal; static #yVal; *m() { return 42; } + ; *m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 283f4bb57c..710acab0ee 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,41 +61,41 @@ info: | class C { - static async #$(value) { + static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; }; m() { return 42; } - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index 9852b31b81..e9227dc9a6 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; }; m() { return 42; } - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index 4db8cae136..a653b9444c 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -62,40 +62,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js index d69787b1dd..26f933b6ae 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -62,40 +62,40 @@ info: | class C { static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; }; m() { return 42; } - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-same-line-method-static-private-methods-with-fields.js b/test/language/statements/class/fields-same-line-method-static-private-methods-with-fields.js new file mode 100644 index 0000000000..7f890e5377 --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-static-private-methods-with-fields.js @@ -0,0 +1,83 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: static private methods with fields (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + static #xVal; static #yVal; m() { return 42; } + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-same-line-method-static-private-methods.js b/test/language/statements/class/fields-same-line-method-static-private-methods.js index fd2bf8fd76..1ac5dd9750 100644 --- a/test/language/statements/class/fields-same-line-method-static-private-methods.js +++ b/test/language/statements/class/fields-same-line-method-static-private-methods.js @@ -25,17 +25,15 @@ info: | class C { - static #xVal; static #yVal; m() { return 42; } + ; m() { return 42; } static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -55,18 +53,18 @@ verifyProperty(C.prototype, "m", { }); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js index b9c70eec7f..c580dd569c 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,42 +61,42 @@ info: | class C { ;;;; - ;;;;;;static async #$(value) { + ;;;;;;static async * #$(value) { yield await value; } - static async #_(value) { + static async * #_(value) { yield await value; } - static async #o(value) { + static async * #o(value) { yield await value; } - static async #℘(value) { + static async * #℘(value) { yield await value; } - static async #ZW_‌_NJ(value) { + static async * #ZW_‌_NJ(value) { yield await value; } - static async #ZW_‍_J(value) { + static async * #ZW_‍_J(value) { yield await value; };;;;;;; ;;;; - static async $(value) { - yield * await this.#$(value); + static get $() { + return this.#$; } - static async _(value) { - yield * await this.#_(value); + static get _() { + return this.#_; } - static async o(value) { - yield * await this.#o(value); + static get o() { + return this.#o; } - static async ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static async ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static async ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield * await this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index 4955ed2681..920a91064b 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { ;;;; ;;;;;;static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #\u{6F}(value) { - yield await value; + yield * await value; } static async * #\u2118(value) { - yield await value; + yield * await value; } static async * #ZW_\u200C_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_\u200D_J(value) { - yield await value; + yield * await value; };;;;;;; ;;;; - static async * $(value) { - yield * await this.#$(value); + static async * $() { + return this.#$; } - static async * _(value) { - yield * await this.#_(value); + static async * _() { + return this.#_; } - static async * \u{6F}(value) { - yield * await this.#\u{6F}(value); + static async * \u{6F}() { + return this.#\u{6F}; } - static async * \u2118(value) { - yield * await this.#\u2118(value); + static async * \u2118() { + return this.#\u2118; } - static async * ZW_\u200C_NJ(value) { - yield * await this.#ZW_\u200C_NJ(value); + static async * ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J(value) { - yield * await this.#ZW_\u200D_J(value); + static async * ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js index 6f6590341d..2f6d85be72 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -62,41 +62,41 @@ info: | class C { ;;;; ;;;;;;static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #o(value) { - yield value; + yield * value; } static * #℘(value) { - yield value; + yield * value; } static * #ZW_‌_NJ(value) { - yield value; + yield * value; } static * #ZW_‍_J(value) { - yield value; + yield * value; };;;;;;; ;;;; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * o(value) { - yield this.#o(value); + static get o() { + return this.#o; } - static * ℘(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#℘(value); + static get ℘() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#℘; } - static * ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‌_NJ(value); + static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‌_NJ; } - static * ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD - yield this.#ZW_‍_J(value); + static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD + return this.#ZW_‍_J; } } diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js index 864a3b405b..5bf360a916 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -62,41 +62,41 @@ info: | class C { ;;;; ;;;;;;static * #$(value) { - yield value; + yield * value; } static * #_(value) { - yield value; + yield * value; } static * #\u{6F}(value) { - yield value; + yield * value; } static * #\u2118(value) { - yield value; + yield * value; } static * #ZW_\u200C_NJ(value) { - yield value; + yield * value; } static * #ZW_\u200D_J(value) { - yield value; + yield * value; };;;;;;; ;;;; - static * $(value) { - yield this.#$(value); + static get $() { + return this.#$; } - static * _(value) { - yield this.#_(value); + static get _() { + return this.#_; } - static * \u{6F}(value) { - yield this.#\u{6F}(value); + static get \u{6F}() { + return this.#\u{6F}; } - static * \u2118(value) { - yield this.#\u2118(value); + static get \u2118() { + return this.#\u2118; } - static * ZW_\u200C_NJ(value) { - yield this.#ZW_\u200C_NJ(value); + static get ZW_\u200C_NJ() { + return this.#ZW_\u200C_NJ; } - static * ZW_\u200D_J(value) { - yield this.#ZW_\u200D_J(value); + static get ZW_\u200D_J() { + return this.#ZW_\u200D_J; } } diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-private-methods-with-fields.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods-with-fields.js new file mode 100644 index 0000000000..5ef217f215 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods-with-fields.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-private-methods-with-fields.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: static private methods with fields (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class-static-methods-private, class-static-fields-private, class, class-fields-public] +flags: [generated] +info: | + ClassElement : + ... + static FieldDefinition ; + + FieldDefinition : + ClassElementName Initializer_opt + + ClassElementName : + PrivateName + + PrivateName : + # IdentifierName + +---*/ + + +class C { + ;;;; + ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;; + static #x(value) { + this.#xVal = value; + return this.#xVal; + } + static #y(value) { + this.#yVal = value; + return this.#yVal; + } + static x() { + return this.#x(42); + } + static y() { + return this.#y(43); + } +} + +var c = new C(); + +// Test the private methods do not appear as properties before set to value +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 7"); +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 8"); +assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 9"); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 11"); +assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 12"); + +// Test if private fields can be sucessfully accessed and set to value +assert.sameValue(C.x(), 42, "test 13"); +assert.sameValue(C.y(), 43, "test 14"); + +// Test the private fields do not appear as properties before after set to value +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 15"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 16"); + +assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 17"); +assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 18"); diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js index 1ad7a3ab04..c547acb8dd 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-private-methods.js @@ -25,18 +25,16 @@ info: | class C { ;;;; - ;;;;;;static #xVal; static #yVal;;;;;;; + ;;;;;;;;;;;;; ;;;; static #x(value) { - this.#xVal = value; - return this.#xVal; + return value / 2; } static #y(value) { - this.#y = value; - return this.#yVal; + return value * 2; } static x() { - return this.#x(42); + return this.#x(84); } static y() { return this.#y(43); @@ -46,18 +44,18 @@ class C { var c = new C(); // Test the private methods do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#xVal"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#xVal"), false, "test 3"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); +assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#yVal"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#yVal"), false, "test 6"); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); +assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); // Test if private fields can be sucessfully accessed and set to value assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); +assert.sameValue(C.y(), 86, "test 8"); // Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#xVal"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#yVal"), false, "test 10"); +assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); +assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); From d4fc8d6fc97a10e1c4d7ab58957dc23a18402f9f Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:31:10 -0400 Subject: [PATCH 27/40] Fix cases for ASI --- ...field-def-has-initializer-no-sc-error.case | 27 ------------ src/class-fields/literal-names-asi.case | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 27 deletions(-) delete mode 100644 src/class-fields/grammar-field-def-has-initializer-no-sc-error.case create mode 100644 src/class-fields/literal-names-asi.case diff --git a/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case b/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case deleted file mode 100644 index 7c117a00af..0000000000 --- a/src/class-fields/grammar-field-def-has-initializer-no-sc-error.case +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018 Rick Waldron. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: SyntaxError -info: | - - ClassElement : - MethodDefinition - static MethodDefinition - FieldDefinition ; - ; - - FieldDefinition : - ClassElementName Initializer _opt - - ClassElementName : - PropertyName - PrivateName - -template: syntax/invalid -features: [class-fields-private] ----*/ - -//- fields -x = [] -y; diff --git a/src/class-fields/literal-names-asi.case b/src/class-fields/literal-names-asi.case new file mode 100644 index 0000000000..8e7cd1bc36 --- /dev/null +++ b/src/class-fields/literal-names-asi.case @@ -0,0 +1,42 @@ +// Copyright (C) 2017 the V8 project authors, 2017 Igalia S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Literal property names with ASI +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName +template: productions +includes: [propertyHelper.js] +---*/ + +//- fields +a +b = 42; +//- assertions +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); From 96809308fda91f2810e93dddc6f1b0cb4544ce36 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:33:58 -0400 Subject: [PATCH 28/40] Generate tests --- ...s-after-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...fter-same-line-method-literal-names-asi.js | 60 ++++++++++++ ...line-static-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...e-static-async-method-literal-names-asi.js | 73 ++++++++++++++ ...-same-line-static-gen-literal-names-asi.js | 60 ++++++++++++ ...me-line-static-method-literal-names-asi.js | 60 ++++++++++++ ...-multiple-definitions-literal-names-asi.js | 96 +++++++++++++++++++ ...e-stacked-definitions-literal-names-asi.js | 74 ++++++++++++++ ...new-no-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...ields-new-sc-line-gen-literal-names-asi.js | 61 ++++++++++++ ...ds-new-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...s-regular-definitions-literal-names-asi.js | 50 ++++++++++ ...s-same-line-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...ame-line-async-method-literal-names-asi.js | 73 ++++++++++++++ .../fields-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...elds-same-line-method-literal-names-asi.js | 60 ++++++++++++ .../fields-wrapped-in-sc-literal-names-asi.js | 52 ++++++++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ------- ...s-after-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...fter-same-line-method-literal-names-asi.js | 60 ++++++++++++ ...line-static-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...e-static-async-method-literal-names-asi.js | 73 ++++++++++++++ ...-same-line-static-gen-literal-names-asi.js | 60 ++++++++++++ ...me-line-static-method-literal-names-asi.js | 60 ++++++++++++ ...-multiple-definitions-literal-names-asi.js | 96 +++++++++++++++++++ ...e-stacked-definitions-literal-names-asi.js | 74 ++++++++++++++ ...new-no-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...ields-new-sc-line-gen-literal-names-asi.js | 61 ++++++++++++ ...ds-new-sc-line-method-literal-names-asi.js | 61 ++++++++++++ ...s-regular-definitions-literal-names-asi.js | 50 ++++++++++ ...s-same-line-async-gen-literal-names-asi.js | 74 ++++++++++++++ ...ame-line-async-method-literal-names-asi.js | 73 ++++++++++++++ .../fields-same-line-gen-literal-names-asi.js | 60 ++++++++++++ ...elds-same-line-method-literal-names-asi.js | 60 ++++++++++++ .../fields-wrapped-in-sc-literal-names-asi.js | 52 ++++++++++ ...r-field-def-has-initializer-no-sc-error.js | 35 ------- 36 files changed, 2218 insertions(+), 70 deletions(-) create mode 100644 test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-regular-definitions-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-gen-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-same-line-method-literal-names-asi.js create mode 100644 test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js delete mode 100644 test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js create mode 100644 test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-multiple-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-regular-definitions-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-async-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-gen-literal-names-asi.js create mode 100644 test/language/statements/class/fields-same-line-method-literal-names-asi.js create mode 100644 test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js delete mode 100644 test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js diff --git a/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..07d3594394 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-gen.template +/*--- +description: Literal property names with ASI (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..eef03956a0 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..a387bee8cc --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js new file mode 100644 index 0000000000..05fe894bf2 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template +/*--- +description: Literal property names with ASI (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static async m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js new file mode 100644 index 0000000000..3a469c562a --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js b/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js new file mode 100644 index 0000000000..54566a3479 --- /dev/null +++ b/test/language/expressions/class/fields-after-same-line-static-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template +/*--- +description: Literal property names with ASI (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + static m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js b/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js new file mode 100644 index 0000000000..74fd80c2f7 --- /dev/null +++ b/test/language/expressions/class/fields-multiple-definitions-literal-names-asi.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-multiple-definitions.template +/*--- +description: Literal property names with ASI (multiple fields definitions) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + foo = "foobar"; + m() { return 42 } + a + b = 42; + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js new file mode 100644 index 0000000000..08d39ea46c --- /dev/null +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template +/*--- +description: Literal property names with ASI (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..fcbc885124 --- /dev/null +++ b/test/language/expressions/class/fields-new-no-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..e8a7097b2e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-gen-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js b/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..f98ab8c65e --- /dev/null +++ b/test/language/expressions/class/fields-new-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-new-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js b/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js new file mode 100644 index 0000000000..95f92f5691 --- /dev/null +++ b/test/language/expressions/class/fields-regular-definitions-literal-names-asi.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-regular-definitions.template +/*--- +description: Literal property names with ASI (regular fields defintion) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js b/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..35d3ee1db6 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js b/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js new file mode 100644 index 0000000000..413ced87f5 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template +/*--- +description: Literal property names with ASI (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + async m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js b/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..1bbd48d5b3 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-same-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-same-line-method-literal-names-asi.js b/test/language/expressions/class/fields-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..ff7f4722a1 --- /dev/null +++ b/test/language/expressions/class/fields-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + a + b = 42;; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js b/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js new file mode 100644 index 0000000000..3c1b690ee0 --- /dev/null +++ b/test/language/expressions/class/fields-wrapped-in-sc-literal-names-asi.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template +/*--- +description: Literal property names with ASI (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +var C = class { + ;;;; + ;;;;;;a + b = 42;;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js deleted file mode 100644 index bc825b5981..0000000000 --- a/test/language/expressions/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case -// - src/class-fields/syntax/invalid/cls-expr-fields-invalid-syntax.template -/*--- -description: SyntaxError (class expression) -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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -var C = class { - x = [] - y; -}; diff --git a/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..8c1194f166 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-gen.template +/*--- +description: Literal property names with ASI (field definitions after a generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..53ee508026 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions after a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..789d6d0a8b --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js new file mode 100644 index 0000000000..77550e6155 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template +/*--- +description: Literal property names with ASI (field definitions after a static async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static async m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +C.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js new file mode 100644 index 0000000000..930fa094c3 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template +/*--- +description: Literal property names with ASI (field definitions after a static generator in the same line) +esid: prod-FieldDefinition +features: [generators, class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(C.m().next().value, 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js b/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js new file mode 100644 index 0000000000..f2a5ddda86 --- /dev/null +++ b/test/language/statements/class/fields-after-same-line-static-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template +/*--- +description: Literal property names with ASI (field definitions after a static method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + static m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(C.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "m"), false); + +verifyProperty(C, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js b/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js new file mode 100644 index 0000000000..05e4df8328 --- /dev/null +++ b/test/language/statements/class/fields-multiple-definitions-literal-names-asi.js @@ -0,0 +1,96 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-multiple-definitions.template +/*--- +description: Literal property names with ASI (multiple fields definitions) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + foo = "foobar"; + m() { return 42 } + a + b = 42; + m2() { return 39 } + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.m2(), 39); +assert.sameValue(Object.hasOwnProperty.call(c, "m2"), false); +assert.sameValue(c.m2, C.prototype.m2); + +verifyProperty(C.prototype, "m2", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js new file mode 100644 index 0000000000..bfebc2458c --- /dev/null +++ b/test/language/statements/class/fields-multiple-stacked-definitions-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template +/*--- +description: Literal property names with ASI (multiple stacked fields definitions through ASI) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + foo = "foobar" + bar = "barbaz"; + +} + +var c = new C(); + +assert.sameValue(c.foo, "foobar"); +assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); + +verifyProperty(c, "foo", { + value: "foobar", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c.bar, "barbaz"); +assert.sameValue(Object.hasOwnProperty.call(C, "bar"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); + +verifyProperty(c, "bar", { + value: "barbaz", + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js b/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..a8589849e9 --- /dev/null +++ b/test/language/statements/class/fields-new-no-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line without a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js b/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..985a74b5c5 --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-gen-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; + *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js b/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js new file mode 100644 index 0000000000..9a7c48d27a --- /dev/null +++ b/test/language/statements/class/fields-new-sc-line-method-literal-names-asi.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-new-sc-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in a new line with a semicolon) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; + m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-regular-definitions-literal-names-asi.js b/test/language/statements/class/fields-regular-definitions-literal-names-asi.js new file mode 100644 index 0000000000..d973f9c268 --- /dev/null +++ b/test/language/statements/class/fields-regular-definitions-literal-names-asi.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-regular-definitions.template +/*--- +description: Literal property names with ASI (regular fields defintion) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js b/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js new file mode 100644 index 0000000000..8e6acab61e --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-gen-literal-names-asi.js @@ -0,0 +1,74 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template +/*--- +description: Literal property names with ASI (field definitions after an async generator in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-iteration] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async *m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().next().then(function(v) { + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js b/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js new file mode 100644 index 0000000000..b1b6d62778 --- /dev/null +++ b/test/language/statements/class/fields-same-line-async-method-literal-names-asi.js @@ -0,0 +1,73 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template +/*--- +description: Literal property names with ASI (field definitions after an async method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, async-functions] +flags: [generated, async] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + async m() { return 42; } a + b = 42;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); +assert.sameValue(c.m, C.prototype.m); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}, {restore: true}); + +c.m().then(function(v) { + assert.sameValue(v, 42); + + function assertions() { + // Cover $DONE handler for async cases. + function $DONE(error) { + if (error) { + throw new Test262Error('Test262:AsyncTestFailure') + } + } + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + + verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true + }); + + assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); + assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + + verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true + }); + } + + return Promise.resolve(assertions()); +}, $DONE).then($DONE, $DONE); diff --git a/test/language/statements/class/fields-same-line-gen-literal-names-asi.js b/test/language/statements/class/fields-same-line-gen-literal-names-asi.js new file mode 100644 index 0000000000..0455dc9a8b --- /dev/null +++ b/test/language/statements/class/fields-same-line-gen-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-same-line-generator.template +/*--- +description: Literal property names with ASI (field definitions followed by a generator method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public, generators] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; *m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m().next().value, 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-same-line-method-literal-names-asi.js b/test/language/statements/class/fields-same-line-method-literal-names-asi.js new file mode 100644 index 0000000000..e6df12efcd --- /dev/null +++ b/test/language/statements/class/fields-same-line-method-literal-names-asi.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-same-line-method.template +/*--- +description: Literal property names with ASI (field definitions followed by a method in the same line) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + a + b = 42;; m() { return 42; } + +} + +var c = new C(); + +assert.sameValue(c.m(), 42); +assert.sameValue(c.m, C.prototype.m); +assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); + +verifyProperty(C.prototype, "m", { + enumerable: false, + configurable: true, + writable: true, +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js b/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js new file mode 100644 index 0000000000..a566fa0494 --- /dev/null +++ b/test/language/statements/class/fields-wrapped-in-sc-literal-names-asi.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/literal-names-asi.case +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template +/*--- +description: Literal property names with ASI (fields definition wrapped in semicolons) +esid: prod-FieldDefinition +features: [class, class-fields-public] +flags: [generated] +includes: [propertyHelper.js] +info: | + ClassElement: + ... + FieldDefinition ; + + FieldDefinition: + ClassElementName Initializer_opt + + ClassElementName: + PropertyName + +---*/ + + +class C { + ;;;; + ;;;;;;a + b = 42;;;;;;;; + ;;;; + +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); + +verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js b/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js deleted file mode 100644 index b0eb3a3a07..0000000000 --- a/test/language/statements/class/syntax-invalid-grammar-field-def-has-initializer-no-sc-error.js +++ /dev/null @@ -1,35 +0,0 @@ -// This file was procedurally generated from the following sources: -// - src/class-fields/grammar-field-def-has-initializer-no-sc-error.case -// - src/class-fields/syntax/invalid/cls-decl-fields-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 - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - x = [] - y; -} From 2ec2a007911232c65c67a810f491ce37530de1e8 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:37:34 -0400 Subject: [PATCH 29/40] missing get method --- ...sync-generator-method-privatename-identifier.case | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case index 7f299d5074..a343d9183c 100644 --- a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case @@ -78,22 +78,22 @@ static async * #ZW_\u200D_J(value) { yield * await value; } //- privateinspectionfunctions -static async * $() { +static get $() { return this.#$; } -static async * _() { +static get _() { return this.#_; } -static async * \u{6F}() { +static get \u{6F}() { return this.#\u{6F}; } -static async * \u2118() { +static get \u2118() { return this.#\u2118; } -static async * ZW_\u200C_NJ() { +static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } -static async * ZW_\u200D_J() { +static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } From de1bbd65c86bf493391c96e4c5f513020133e4f5 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 13:37:53 -0400 Subject: [PATCH 30/40] Generate tests --- ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ 34 files changed, 204 insertions(+), 204 deletions(-) diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 69981853c9..4b014a8156 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index f5d7e71e45..2eaaaba66c 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index 1fea76cae8..ce9eed40a9 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index 3a88a620fb..8f4cadcc61 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index 06356c8527..6d247d4379 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index 08ac599fc1..2cbd9a07f5 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index 60c154bcfc..67cfe3d0bb 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -83,22 +83,22 @@ var C = class { } m2() { return 39 } bar = "barbaz"; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index ff89ffcfd8..801d9cf3aa 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -81,22 +81,22 @@ var C = class { } foo = "foobar" bar = "barbaz"; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index ddbdd56fe2..8b9c58cf72 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ var C = class { yield * await value; } m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index fee12a971c..e26d8192ce 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ var C = class { yield * await value; }; *m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 4566198a9d..111d83df3e 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ var C = class { yield * await value; }; m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 6ed93f3153..11a2739f37 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -78,22 +78,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index b15158abc9..b596bf98a8 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index b7e573ad48..56860daf58 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 5c42a9ecee..ca83b3e154 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; *m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index bd54b46961..9b34cebb9f 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ var C = class { static async * #ZW_\u200D_J(value) { yield * await value; }; m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index 55fecc3a8d..eb41e7ffaa 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ var C = class { yield * await value; };;;;;;; ;;;; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 6d5be48070..a06c06ff00 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index 4d2481015e..08d2effc19 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index cac96c4d83..a2a9e59e1a 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index bc70b593d5..d2a3ba48e7 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index 04ab8befe4..a16c33c9fa 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index 20506e5884..bf50dddb27 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index ee2add8863..8f1479e3a2 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -83,22 +83,22 @@ class C { } m2() { return 39 } bar = "barbaz"; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index 0e3a704d67..a4baf7ac44 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -81,22 +81,22 @@ class C { } foo = "foobar" bar = "barbaz"; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index a3a80442c1..c1ad50dd02 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ class C { yield * await value; } m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index dce0673774..29ba091638 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ class C { yield * await value; }; *m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 26faa8654c..ad8a361662 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ class C { yield * await value; }; m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 33a5f10f93..872b6fb71c 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -78,22 +78,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index 5c5d6ef151..3ec0687a02 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index 1a445b93e9..5f60552021 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index df02c740c9..5ae16cd077 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; *m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index e9227dc9a6..adb2f7ef91 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -79,22 +79,22 @@ class C { static async * #ZW_\u200D_J(value) { yield * await value; }; m() { return 42; } - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index 920a91064b..23e09b3af5 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -80,22 +80,22 @@ class C { yield * await value; };;;;;;; ;;;; - static async * $() { + static get $() { return this.#$; } - static async * _() { + static get _() { return this.#_; } - static async * \u{6F}() { + static get \u{6F}() { return this.#\u{6F}; } - static async * \u2118() { + static get \u2118() { return this.#\u2118; } - static async * ZW_\u200C_NJ() { + static get ZW_\u200C_NJ() { return this.#ZW_\u200C_NJ; } - static async * ZW_\u200D_J() { + static get ZW_\u200D_J() { return this.#ZW_\u200D_J; } From 345b93377fbdb8953a9f5ee18b8a89b04b0ac955 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 17:12:18 -0400 Subject: [PATCH 31/40] fix templates path --- .../cls-decl-private-fields-eval.template | 2 +- .../cls-decl-private-fields-indirect-eval.template | 2 +- .../cls-expr-private-fields-eval.template | 2 +- .../cls-expr-private-fields-indirect-eval.template | 2 +- .../cls-decl-private-fields-eval.template | 2 +- .../cls-decl-private-fields-indirect-eval.template | 2 +- .../cls-expr-private-fields-eval.template | 2 +- .../cls-expr-private-fields-indirect-eval.template | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template index 2b52bf407e..1e910bf87a 100644 --- a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/statements/class/fields-derived-cls-direct- +path: language/statements/class/fields-private-derived-cls-direct- name: direct eval ---*/ diff --git a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template index 20c2d86156..cc49df82ab 100644 --- a/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/statements/class/fields-derived-cls-indirect- +path: language/statements/class/fields-private-derived-cls-indirect- name: indirect eval ---*/ diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template index d1953958ec..ea4c3586eb 100644 --- a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/expressions/class/fields-derived-cls-direct- +path: language/expressions/class/fields-private-derived-cls-direct- name: direct eval ---*/ diff --git a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template index fef18bb5f1..9fcd914567 100644 --- a/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/expressions/class/fields-derived-cls-indirect- +path: language/expressions/class/fields-private-derived-cls-indirect- name: indirect eval ---*/ diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template index 250b36d4c1..7934a034f0 100644 --- a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/statements/class/fields-derived-cls-direct- +path: language/statements/class/fields-private-derived-cls-direct- name: direct eval ---*/ diff --git a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template index 20c2d86156..cc49df82ab 100644 --- a/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/statements/class/fields-derived-cls-indirect- +path: language/statements/class/fields-private-derived-cls-indirect- name: indirect eval ---*/ diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template index b11847616d..289a1dd242 100644 --- a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/expressions/class/fields-derived-cls-direct- +path: language/expressions/class/fields-private-derived-cls-direct- name: direct eval ---*/ diff --git a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template index 9a0aec624f..2aa8245cd4 100644 --- a/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template +++ b/src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template @@ -3,7 +3,7 @@ /*--- esid: sec-performeval-rules-in-initializer -path: language/expressions/class/fields-derived-cls-indirect- +path: language/expressions/class/fields-private-derived-cls-indirect- name: indirect eval ---*/ From 9a7fa8cb911ad9796f27ddd49c4af1a0e5f5abe9 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 20 Aug 2018 17:12:33 -0400 Subject: [PATCH 32/40] Generate tests --- ...ls-direct-eval-err-contains-supercall-1.js | 36 +++++++++++++++++++ ...ls-direct-eval-err-contains-supercall-2.js | 29 +++++++++++++++ ...-cls-direct-eval-err-contains-supercall.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-1.js | 34 ++++++++++++++++++ ...irect-eval-err-contains-superproperty-2.js | 31 ++++++++++++++++ ...-indirect-eval-err-contains-supercall-1.js | 36 +++++++++++++++++++ ...-indirect-eval-err-contains-supercall-2.js | 29 +++++++++++++++ ...ls-indirect-eval-err-contains-supercall.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-1.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-2.js | 33 +++++++++++++++++ ...-indirect-eval-err-contains-supercall-1.js | 4 +-- ...-indirect-eval-err-contains-supercall-2.js | 4 +-- ...ls-indirect-eval-err-contains-supercall.js | 4 +-- ...irect-eval-err-contains-superproperty-1.js | 4 +-- ...irect-eval-err-contains-superproperty-2.js | 4 +-- ...ls-direct-eval-err-contains-supercall-1.js | 36 +++++++++++++++++++ ...ls-direct-eval-err-contains-supercall-2.js | 29 +++++++++++++++ ...-cls-direct-eval-err-contains-supercall.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-1.js | 34 ++++++++++++++++++ ...irect-eval-err-contains-superproperty-2.js | 31 ++++++++++++++++ ...-indirect-eval-err-contains-supercall-1.js | 36 +++++++++++++++++++ ...-indirect-eval-err-contains-supercall-2.js | 29 +++++++++++++++ ...ls-indirect-eval-err-contains-supercall.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-1.js | 36 +++++++++++++++++++ ...irect-eval-err-contains-superproperty-2.js | 33 +++++++++++++++++ 25 files changed, 682 insertions(+), 10 deletions(-) create mode 100644 test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js create mode 100644 test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js create mode 100644 test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js create mode 100644 test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js create mode 100644 test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js create mode 100644 test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js create mode 100644 test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js create mode 100644 test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js create mode 100644 test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js create mode 100644 test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js create mode 100644 test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js create mode 100644 test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..17351e3ac1 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..6c079ff81e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super().x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js new file mode 100644 index 0000000000..5e4364c58c --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super()` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..9bcac948c1 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template +/*--- +description: error if `super.x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super.x;'); +}; + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..0afe73ea33 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template +/*--- +description: error if super['x'] in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super["x"];'); +}; + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..f4532dc6ac --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..cb9d794e6e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super().x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js new file mode 100644 index 0000000000..9727b8b82e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super()` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..91ea12f15b --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super.x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super.x;'); +}; + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..680bba0434 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if super['x'] in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super["x"];'); +}; + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index a8375776ce..899f3e41b3 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-1.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super()['x']` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super()["x"];'); + x = (0, eval)('executed = true; super()["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index 586a59e3b0..157a843836 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-2.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super().x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -19,7 +19,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super().x;'); + x = (0, eval)('executed = true; super().x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index d4999d75df..605c574ec3 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super()` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super();'); + x = (0, eval)('executed = true; super();'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index ddeafb7253..222abc22f6 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-1.case -// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template /*--- description: error if `super.x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super.x;'); + x = (0, eval)('executed = true; super.x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js index 2ed9f8c6a1..cb54407062 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-2.case -// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template /*--- description: error if super['x'] in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -23,7 +23,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super["x"];'); + x = (0, eval)('executed = true; super["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..5c6f0e3d4c --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..200f61f719 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super().x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js new file mode 100644 index 0000000000..b539515995 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super()` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..f649a7460e --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template +/*--- +description: error if `super.x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super.x;'); +} + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..5247e1b4a2 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template +/*--- +description: error if super['x'] in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super["x"];'); +} + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..a8375776ce --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..586a59e3b0 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super().x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js new file mode 100644 index 0000000000..d4999d75df --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super()` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..ddeafb7253 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super.x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super.x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..2ed9f8c6a1 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if super['x'] in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); From 7ea8043fcac1524e26e53e4e74c15c5554fd8ec6 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 12:06:28 -0400 Subject: [PATCH 33/40] rewrite values for yield star --- ...sync-generator-method-privatename-identifier.case | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case index a343d9183c..626d722885 100644 --- a/src/class-fields/rs-static-async-generator-method-privatename-identifier.case +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier.case @@ -99,12 +99,12 @@ static get ZW_\u200D_J() { //- assertions Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); From dacc69a0663565e170c921ea6b43d3ae9d9b80ea Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 12:17:05 -0400 Subject: [PATCH 34/40] Generate tests --- ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ ...-async-generator-method-privatename-identifier.js | 12 ++++++------ 34 files changed, 204 insertions(+), 204 deletions(-) diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 4b014a8156..bae56d5c2b 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index 2eaaaba66c..2ae19a3bb8 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index ce9eed40a9..e350c81140 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -123,12 +123,12 @@ C.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index 8f4cadcc61..7a24bd56c0 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ C.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index 6d247d4379..48e45f6a24 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index 2cbd9a07f5..4310a99404 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index 67cfe3d0bb..c346428615 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -149,12 +149,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index 801d9cf3aa..cb89aa6c7f 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -127,12 +127,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 8b9c58cf72..1719c27d33 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index e26d8192ce..429fb16235 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index 111d83df3e..033f6e4760 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 11a2739f37..3fccfbdb06 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -102,12 +102,12 @@ var C = class { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index b596bf98a8..925e1d88a9 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -123,12 +123,12 @@ c.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index 56860daf58..0ebf8fd9e9 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ c.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index ca83b3e154..19b21bf6f6 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index 9b34cebb9f..ddbd721b26 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index eb41e7ffaa..7cb7afee08 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -104,12 +104,12 @@ var C = class { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index a06c06ff00..06f9c16e57 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js index 08d2effc19..aaa9a76cdf 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js index a2a9e59e1a..3eb7df01bc 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -123,12 +123,12 @@ C.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js index d2a3ba48e7..928c7a3504 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ C.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js index a16c33c9fa..0e1bf45615 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js index bf50dddb27..d857b9877c 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js index 8f1479e3a2..4550c3c3bd 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -149,12 +149,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js index a4baf7ac44..77a92a1776 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -127,12 +127,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index c1ad50dd02..e25100992d 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js index 29ba091638..3c24840657 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js index ad8a361662..fcbd92dfc3 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js index 872b6fb71c..88795cdfd9 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier.js @@ -102,12 +102,12 @@ class C { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js index 3ec0687a02..62c15150b3 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier.js @@ -123,12 +123,12 @@ c.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js index 5f60552021..d7dc8406ab 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ c.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js index 5ae16cd077..85c237cc9d 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js index adb2f7ef91..4ee954f48e 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier.js @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js index 23e09b3af5..a320582b30 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier.js @@ -104,12 +104,12 @@ class C { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.\u{6F}(1).next(), - C.\u2118(1).next(), - C.ZW_\u200C_NJ(1).next(), - C.ZW_\u200D_J(1).next(), + C.$([1]).next(), + C._([1]).next(), + C.\u{6F}([1]).next(), + C.\u2118([1]).next(), + C.ZW_\u200C_NJ([1]).next(), + C.ZW_\u200D_J([1]).next(), ]).then(results => { assert.sameValue(results[0].value, 1); From 0cc5e356c141da01c18714389f63c0c359c3ee03 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 12:43:50 -0400 Subject: [PATCH 35/40] Other cases of yield * with iterable values --- ...tor-method-privatename-identifier-alt.case | 24 +++++++++---------- ...tor-method-privatename-identifier-alt.case | 12 +++++----- ...nerator-method-privatename-identifier.case | 12 +++++----- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case index d43fe887e2..d1423a6ef3 100644 --- a/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case +++ b/src/class-fields/rs-static-async-generator-method-privatename-identifier-alt.case @@ -60,22 +60,22 @@ features: [class-static-methods-private] //- fields static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } //- privateinspectionfunctions static get $() { @@ -99,12 +99,12 @@ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD //- assertions Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case index 9fe46136af..e3a4ab84ff 100644 --- a/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case +++ b/src/class-fields/rs-static-generator-method-privatename-identifier-alt.case @@ -97,9 +97,9 @@ static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD } //- assertions -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/src/class-fields/rs-static-generator-method-privatename-identifier.case b/src/class-fields/rs-static-generator-method-privatename-identifier.case index a263c82684..c239a61ba3 100644 --- a/src/class-fields/rs-static-generator-method-privatename-identifier.case +++ b/src/class-fields/rs-static-generator-method-privatename-identifier.case @@ -97,10 +97,10 @@ static get ZW_\u200D_J() { } //- assertions -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); From 3690d98e27a7acb31ed6e193d88741f5a81a7229 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 12:47:19 -0400 Subject: [PATCH 36/40] Generate tests --- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...computed-name-static-propname-prototype.js | 2 -- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- ...rator-method-privatename-identifier-alt.js | 24 +++++++++---------- ...rator-method-privatename-identifier-alt.js | 12 +++++----- ...generator-method-privatename-identifier.js | 12 +++++----- 103 files changed, 816 insertions(+), 818 deletions(-) diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index b4820018ae..bc9b482aa2 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index ff21ef06f3..d18c62fd51 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js index 8206125d7d..28126d257f 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 9f06a4102a..128b6e57ff 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index e9e52f25ac..08eeda123b 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js index dc0d84ce97..b488e5dccc 100644 --- a/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 7cf2aac622..dd833e8408 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -123,12 +123,12 @@ C.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js index 31b3575d57..65c0f30e20 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -122,12 +122,12 @@ C.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js index fdc6e94eca..0d4ad79cfb 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ C.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 6df986a9ca..fc1613c9a1 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -122,12 +122,12 @@ C.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js index d11fcb72c7..b65691ff47 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -121,12 +121,12 @@ C.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js index d54a82407f..a167d00ec8 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -121,12 +121,12 @@ C.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js index ce4adc3b88..2e930d3d31 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js index fa18e79e92..a71075bacd 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js index f7307965b2..62c82b5f35 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js index 72fd281cbf..6821cf375e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js index c6d12d3884..1540b34dca 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js index 4233c9282d..041e12beb4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js index 3d374d8d00..ab2c5f272b 100644 --- a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -20,12 +20,10 @@ info: | negative: phase: parse type: SyntaxError - ---*/ throw "Test262: This statement should not be evaluated."; - var x = "prototype"; var C = class { static [x]; diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 2d1c0a1057..f78706c5e1 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -64,22 +64,22 @@ var C = class { foo = "foobar"; m() { return 42 } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } m2() { return 39 } bar = "barbaz"; @@ -149,12 +149,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js index ca6a339d7c..09becad513 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -148,9 +148,9 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js index 020842fa4c..f3cffcf7fd 100644 --- a/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -148,10 +148,10 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 5eb792a6bf..5a7e3aefce 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } foo = "foobar" bar = "barbaz"; @@ -127,12 +127,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js index 7f8e83b6c0..5d300d4a9e 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -126,9 +126,9 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js index 9400b141e6..5ec8e60576 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -126,10 +126,10 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 5199118527..e5cc13fd0d 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index 3fb1465028..47785cfdf0 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js index 6f689fd462..0d6823e7c5 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 2feaf8acde..e1ee82ac32 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 5de6b1771b..31cb679018 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js index 4829ffee53..d224926f98 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 3da00f169a..fefe13253d 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index dd76e7f092..9ce5a7d74a 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js index 21dd9fda45..df089b8c4b 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index eb3667958e..eb64106eb2 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,22 +61,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } static get $() { return this.#$; @@ -102,12 +102,12 @@ var C = class { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js index cd41048da9..0f6b3c93df 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -101,9 +101,9 @@ var C = class { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js index 0c8c0ef053..5d39688aeb 100644 --- a/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -101,10 +101,10 @@ var C = class { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 5858b16d65..2c93f143b7 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -123,12 +123,12 @@ c.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js index 0d367c08f1..990051e9eb 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -122,12 +122,12 @@ c.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js index 00758cd361..da28637aff 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ c.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index f2d7070a42..da3fa39fdb 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -122,12 +122,12 @@ c.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js index cf0352f99b..09e024e162 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -121,12 +121,12 @@ c.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js index 485d37f1d6..a636d2ed4c 100644 --- a/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -121,12 +121,12 @@ c.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index c0f6451faf..47d08e360b 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index a6b44f4160..b62b50d530 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js index 34ea16384f..55b5e5cc0f 100644 --- a/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 7a6d2a9308..96687403e7 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; m() { return 42; } static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index 2dc77c4d4a..730d1ca6ac 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js index 1772d74c12..fea630f947 100644 --- a/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js index f91bf29fbf..605abd75df 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | var C = class { ;;;; ;;;;;;static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; };;;;;;; ;;;; static get $() { @@ -104,12 +104,12 @@ var C = class { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js index 234b1969af..3363fa0921 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -103,9 +103,9 @@ var C = class { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js index 71fb389cf8..8ad65ec62e 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -103,10 +103,10 @@ var C = class { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 14a21f7e65..74acba6895 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 580b11ce44..db29061dfa 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js index 9e66159934..b12ae65640 100644 --- a/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 395e1098bf..2d82e84664 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index 4c0db20b25..df73024859 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js index cc30c68602..8cbbac227f 100644 --- a/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 929ab0f215..cc8e3c9f4f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -123,12 +123,12 @@ C.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js index c3c9c958c3..66d865fea0 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -122,12 +122,12 @@ C.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js index b8a0a51ea6..e97a474340 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-rs-static-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ C.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 423b2460d2..565d8cbe22 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -122,12 +122,12 @@ C.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js index b6e85b8bfc..513d6095a2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -121,12 +121,12 @@ C.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js index 204363818c..066f62474f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-rs-static-generator-method-privatename-identifier.js @@ -121,12 +121,12 @@ C.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 217d5681aa..17e534f3d2 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js index a4137a87fc..0fcd091150 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js index 3e0274bd1f..77429bc425 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js index ad5d3fee90..21a37c00df 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js index 7d9a95c322..e2487c08df 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js index 5379980cb3..c1e26ab9eb 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-after-same-line-static-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index baa3fefd44..b8763e09fb 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -64,22 +64,22 @@ class C { foo = "foobar"; m() { return 42 } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } m2() { return 39 } bar = "barbaz"; @@ -149,12 +149,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js index 390e76a116..7b182cea82 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -148,9 +148,9 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js index be8eaf19d7..43b1afdf96 100644 --- a/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-definitions-rs-static-generator-method-privatename-identifier.js @@ -148,10 +148,10 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index b6731aa850..d1f58c6157 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } foo = "foobar" bar = "barbaz"; @@ -127,12 +127,12 @@ verifyProperty(c, "bar", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js index 3f4f52a932..5402988c3e 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -126,9 +126,9 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js index 44be313327..55fcfa2e5c 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-rs-static-generator-method-privatename-identifier.js @@ -126,10 +126,10 @@ verifyProperty(c, "bar", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 8d3c741766..191aa1894b 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index 0105dbdcd1..8d62502692 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js index f8f665aaed..f86f8bd11a 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index 7faf2d03b8..6f1d1e1fca 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 157c9c25d2..8fa07393c7 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js index 5be0a510d7..5d0200ad40 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-gen-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 758b553478..131c6e5f74 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; m() { return 42; } static get $() { @@ -114,12 +114,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js index f3affd4f37..a332f5adb4 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -113,9 +113,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js index 05daed590e..8c2f9ead20 100644 --- a/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-new-sc-line-method-rs-static-generator-method-privatename-identifier.js @@ -113,10 +113,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js index 816836e01d..e2b2875374 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-async-generator-method-privatename-identifier-alt.js @@ -61,22 +61,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; } static get $() { return this.#$; @@ -102,12 +102,12 @@ class C { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js index 7dc79244d8..b66f4e6a4b 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier-alt.js @@ -101,9 +101,9 @@ class C { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js index 259d0a31f7..d6d2117caa 100644 --- a/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-regular-definitions-rs-static-generator-method-privatename-identifier.js @@ -101,10 +101,10 @@ class C { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js index eee91de28f..98b057cc02 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { async *m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -123,12 +123,12 @@ c.m().next().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js index a9fdec76f6..4ef36bb4f1 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -122,12 +122,12 @@ c.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js index 182d6b5aa1..966698bc54 100644 --- a/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-gen-rs-static-generator-method-privatename-identifier.js @@ -122,12 +122,12 @@ c.m().next().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js index 9439312b16..59d04d9271 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { async m() { return 42; } static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; static get $() { return this.#$; @@ -122,12 +122,12 @@ c.m().then(function(v) { } } Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js index d5a59e4b6f..5d2f61f546 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier-alt.js @@ -121,12 +121,12 @@ c.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.o(1).next().value, 1); - assert.sameValue(C.℘(1).next().value, 1); - assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); - assert.sameValue(C.ZW_‍_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.o([1]).next().value, 1); + assert.sameValue(C.℘([1]).next().value, 1); + assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_‍_J([1]).next().value, 1); } return Promise.resolve(assertions()); diff --git a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js index d6121a144f..d2f5ecfcef 100644 --- a/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-async-method-rs-static-generator-method-privatename-identifier.js @@ -121,12 +121,12 @@ c.m().then(function(v) { throw new Test262Error('Test262:AsyncTestFailure') } } - assert.sameValue(C.$(1).next().value, 1); - assert.sameValue(C._(1).next().value, 1); - assert.sameValue(C.\u{6F}(1).next().value, 1); - assert.sameValue(C.\u2118(1).next().value, 1); - assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); - assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); + assert.sameValue(C.$([1]).next().value, 1); + assert.sameValue(C._([1]).next().value, 1); + assert.sameValue(C.\u{6F}([1]).next().value, 1); + assert.sameValue(C.\u2118([1]).next().value, 1); + assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); + assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); } diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js index ddc2ffc41a..2ae4e2c7d1 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; *m() { return 42; } static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js index 098a3c41f3..e2eff2ccdf 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js index 9fe818f02b..02d9efb595 100644 --- a/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-gen-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js index 710acab0ee..b09fc8b905 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; }; m() { return 42; } static get $() { return this.#$; @@ -113,12 +113,12 @@ verifyProperty(C.prototype, "m", { }); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js index a653b9444c..045008b38b 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier-alt.js @@ -112,9 +112,9 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js index 26f933b6ae..3e1216e305 100644 --- a/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-same-line-method-rs-static-generator-method-privatename-identifier.js @@ -112,10 +112,10 @@ verifyProperty(C.prototype, "m", { writable: true, }); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js index c580dd569c..f270c38716 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-async-generator-method-privatename-identifier-alt.js @@ -62,22 +62,22 @@ info: | class C { ;;;; ;;;;;;static async * #$(value) { - yield await value; + yield * await value; } static async * #_(value) { - yield await value; + yield * await value; } static async * #o(value) { - yield await value; + yield * await value; } static async * #℘(value) { - yield await value; + yield * await value; } static async * #ZW_‌_NJ(value) { - yield await value; + yield * await value; } static async * #ZW_‍_J(value) { - yield await value; + yield * await value; };;;;;;; ;;;; static get $() { @@ -104,12 +104,12 @@ class C { var c = new C(); Promise.all([ - C.$(1).next(), - C._(1).next(), - C.o(1).next(), - C.℘(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‌_NJ(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD - C.ZW_‍_J(1).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.$([1]).next(), + C._([1]).next(), + C.o([1]).next(), + C.℘([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‌_NJ([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD + C.ZW_‍_J([1]).next(), // DO NOT CHANGE THE NAME OF THIS FIELD ]).then(results => { assert.sameValue(results[0].value, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js index 2f6d85be72..83383d8287 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier-alt.js @@ -103,9 +103,9 @@ class C { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.o(1).next().value, 1); -assert.sameValue(C.℘(1).next().value, 1); -assert.sameValue(C.ZW_‌_NJ(1).next().value, 1); -assert.sameValue(C.ZW_‍_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.o([1]).next().value, 1); +assert.sameValue(C.℘([1]).next().value, 1); +assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_‍_J([1]).next().value, 1); diff --git a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js index 5bf360a916..9f32f365e2 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js +++ b/test/language/statements/class/fields-wrapped-in-sc-rs-static-generator-method-privatename-identifier.js @@ -103,10 +103,10 @@ class C { var c = new C(); -assert.sameValue(C.$(1).next().value, 1); -assert.sameValue(C._(1).next().value, 1); -assert.sameValue(C.\u{6F}(1).next().value, 1); -assert.sameValue(C.\u2118(1).next().value, 1); -assert.sameValue(C.ZW_\u200C_NJ(1).next().value, 1); -assert.sameValue(C.ZW_\u200D_J(1).next().value, 1); +assert.sameValue(C.$([1]).next().value, 1); +assert.sameValue(C._([1]).next().value, 1); +assert.sameValue(C.\u{6F}([1]).next().value, 1); +assert.sameValue(C.\u2118([1]).next().value, 1); +assert.sameValue(C.ZW_\u200C_NJ([1]).next().value, 1); +assert.sameValue(C.ZW_\u200D_J([1]).next().value, 1); From 45a31876e746ccc269a0675fe56bec4b596bef76 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 15:50:39 -0400 Subject: [PATCH 37/40] Fix tests for computed names in class fields - ctor and prototype --- ...computed-name-static-propname-prototype.js | 40 +++++----- ...elds-computed-name-propname-constructor.js | 35 ++++++--- ...tatic-computed-var-propname-constructor.js | 71 +++++++++++++++--- ...-static-computed-var-propname-prototype.js | 39 +++++----- ...mputed-name-static-propname-constructor.js | 73 ++++++++++++++++--- ...computed-name-static-propname-prototype.js | 38 +++++----- ...fields-computed-name-toprimitive-symbol.js | 2 - 7 files changed, 207 insertions(+), 91 deletions(-) diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js index ab2c5f272b..e1366634d8 100644 --- a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -1,30 +1,32 @@ // Copyright (C) 2017 Valerie Young. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName) esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] +features: [class, class-static-fields-public] info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. + 14.6.13 Runtime Semantics: ClassDefinitionEvaluation + ... + 16. Perform MakeConstructor(F, false, proto). + ... - // This test file tests the following early error: - Static Semantics: Early Errors + 9.2.10 MakeConstructor ( F [ , writablePrototype [ , prototype ] ] ) - ClassElement : static FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - -negative: - phase: parse - type: SyntaxError + 6. Perform ! DefinePropertyOrThrow(F, "prototype", PropertyDescriptor { [[Value]]: prototype, + [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: false }). ---*/ -throw "Test262: This statement should not be evaluated."; - var x = "prototype"; -var C = class { - static [x]; -}; + +assert.throws(TypeError, function() { + (0, class { + static [x] = 42; + }); +}); + +assert.throws(TypeError, function() { + (0, class { + static [x]; + }); +}); diff --git a/test/language/statements/class/fields-computed-name-propname-constructor.js b/test/language/statements/class/fields-computed-name-propname-constructor.js index 46e19b73a8..6ea84326e7 100644 --- a/test/language/statements/class/fields-computed-name-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-propname-constructor.js @@ -17,20 +17,37 @@ info: | ClassElement : FieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "constructor". -negative: - phase: parse - type: SyntaxError + DefineField(receiver, fieldRecord) + ... + 8. If fieldName is a Private Name, + ... + 9. Else, + a. ... + b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue). + + CreateDataPropertyOrThrow ( O, P, V ) + + ... + 3. Let success be ? CreateDataProperty(O, P, V). + 4. If success is false, throw a TypeError exception. + ... + + CreateDataProperty ( O, P, V ) + + ... + 3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, + [[Configurable]]: true }. + 4. Return ? O.[[DefineOwnProperty]](P, newDesc). +includes: [propertyHelper.js] ---*/ -throw "Test262: This statement should not be evaluated."; - var x = "constructor"; -class C { +class C1 { [x]; } -var c = new C(); +var c1 = new C1(); -assert.sameValue(c.hasOwnProperty("constructor"), true); -assert.sameValue(C.hasOwnProperty("constructor"), false); +assert.sameValue(c1.hasOwnProperty("constructor"), true); +assert.sameValue(C1.hasOwnProperty("constructor"), false); diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js index 1963899949..1d242df881 100644 --- a/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-constructor.js @@ -1,7 +1,7 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. +// Copyright (C) 2017 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +description: static class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-static-fields-public] info: | @@ -10,22 +10,71 @@ info: | ComputedPropertyName : [ AssignmentExpression ] Return empty. + This test file tests the following early error is only valid for a matching PropName: - // This test file tests the following early error: Static Semantics: Early Errors - ClassElement : static FieldDefinition; + ClassElement : static FieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -negative: - phase: parse - type: SyntaxError + -- IDK what is calling InitializeClassElements but I guess it's supposed to be called to + -- set the fields + InitializeClassElements(F, proto) + + ... + 6. For each item element in order from elements, + a. If element.[[Kind]] is "field" and element.[[Placement]] is "static" or "prototype", + ... + ii. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + iii. Perform ? DefineClassElement(receiver, element). + + -- DefineClassElement is probably DefineField in the class fields proposal + + DefineField(receiver, fieldRecord) + + ... + 8. If fieldName is a Private Name, + ... + 9. Else, + a. ... + b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue). + + CreateDataPropertyOrThrow ( O, P, V ) + + ... + 3. Let success be ? CreateDataProperty(O, P, V). + 4. If success is false, throw a TypeError exception. + ... + + CreateDataProperty ( O, P, V ) + + ... + 3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, + [[Configurable]]: true }. + 4. Return ? O.[[DefineOwnProperty]](P, newDesc). +includes: [propertyHelper.js] ---*/ -throw "Test262: This statement should not be evaluated."; - -var x = "constructor"; -class C { +var x = 'constructor'; +class C1 { static [x]; } + +verifyProperty(C1, 'constructor', { + value: undefined, + configurable: true, + writable: true, + enumerable: true, +}); + +class C2 { + static [x] = 42; +} + +verifyProperty(C2, 'constructor', { + value: 42, + configurable: true, + writable: true, + enumerable: true, +}); diff --git a/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js index 4186915a5f..6d46a56f28 100644 --- a/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js +++ b/test/language/statements/class/fields-computed-name-static-computed-var-propname-prototype.js @@ -1,31 +1,32 @@ // Copyright (C) 2017 Valerie Young. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName) esid: sec-class-definitions-static-semantics-early-errors features: [class, class-static-fields-public] info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. + 14.6.13 Runtime Semantics: ClassDefinitionEvaluation + ... + 16. Perform MakeConstructor(F, false, proto). + ... - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : static FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - -negative: - phase: parse - type: SyntaxError + 9.2.10 MakeConstructor ( F [ , writablePrototype [ , prototype ] ] ) + 6. Perform ! DefinePropertyOrThrow(F, "prototype", PropertyDescriptor { [[Value]]: prototype, + [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: false }). ---*/ -throw "Test262: This statement should not be evaluated."; - var x = "prototype"; -class C { - static [x]; -} + +assert.throws(TypeError, function() { + class C { + static [x] = 42; + } +}); + +assert.throws(TypeError, function() { + class C { + static [x]; + } +}); diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js index 218a01bfe5..0f5689a57e 100644 --- a/test/language/statements/class/fields-computed-name-static-propname-constructor.js +++ b/test/language/statements/class/fields-computed-name-static-propname-constructor.js @@ -1,30 +1,79 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. +// Copyright (C) 2017 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +description: static class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) esid: sec-class-definitions-static-semantics-early-errors -features: [class-static-fields-public] +features: [class, class-static-fields-public] info: | Static Semantics: PropName ... ComputedPropertyName : [ AssignmentExpression ] Return empty. + This test file tests the following early error is only valid for a matching PropName: - // This test file tests the following early error: Static Semantics: Early Errors - ClassElement : static FieldDefinition; + ClassElement : static FieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -negative: - phase: parse - type: SyntaxError + -- IDK what is calling InitializeClassElements but I guess it's supposed to be called to + -- set the fields + InitializeClassElements(F, proto) + + ... + 6. For each item element in order from elements, + a. If element.[[Kind]] is "field" and element.[[Placement]] is "static" or "prototype", + ... + ii. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + iii. Perform ? DefineClassElement(receiver, element). + + -- DefineClassElement is probably DefineField in the class fields proposal + + DefineField(receiver, fieldRecord) + + ... + 8. If fieldName is a Private Name, + ... + 9. Else, + a. ... + b. Perform ? CreateDataPropertyOrThrow(receiver, fieldName, initValue). + + CreateDataPropertyOrThrow ( O, P, V ) + + ... + 3. Let success be ? CreateDataProperty(O, P, V). + 4. If success is false, throw a TypeError exception. + ... + + CreateDataProperty ( O, P, V ) + + ... + 3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, + [[Configurable]]: true }. + 4. Return ? O.[[DefineOwnProperty]](P, newDesc). +includes: [propertyHelper.js] ---*/ -throw "Test262: This statement should not be evaluated."; - -class C { - static ["constructor"]; +class C1 { + static ['constructor']; } + +verifyProperty(C1, 'constructor', { + value: undefined, + configurable: true, + writable: true, + enumerable: true, +}); + +class C2 { + static ['constructor'] = 42; +} + +verifyProperty(C2, 'constructor', { + value: 42, + configurable: true, + writable: true, + enumerable: true, +}); diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js index 32e416a369..0444215278 100644 --- a/test/language/statements/class/fields-computed-name-static-propname-prototype.js +++ b/test/language/statements/class/fields-computed-name-static-propname-prototype.js @@ -1,30 +1,30 @@ // Copyright (C) 2017 Valerie Young. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName) esid: sec-class-definitions-static-semantics-early-errors -features: [class-static-fields-public] +features: [class, class-static-fields-public] info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. + 14.6.13 Runtime Semantics: ClassDefinitionEvaluation + ... + 16. Perform MakeConstructor(F, false, proto). + ... - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : static FieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". - -negative: - phase: parse - type: SyntaxError + 9.2.10 MakeConstructor ( F [ , writablePrototype [ , prototype ] ] ) + 6. Perform ! DefinePropertyOrThrow(F, "prototype", PropertyDescriptor { [[Value]]: prototype, + [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: false }). ---*/ -throw "Test262: This statement should not be evaluated."; +assert.throws(TypeError, function() { + class C { + static ['prototype'] = 42; + } +}); -class C { - static ["prototype"]; -} +assert.throws(TypeError, function() { + class C { + static ['prototype']; + } +}); diff --git a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js index 8818450017..b68841fce4 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js @@ -62,8 +62,6 @@ var obj3 = { valueOf: function() { return s3; } }; - - class C { [obj1] = 42; [obj2] = 43; From e25e53c0a74e5988b48d02275367af3e67ece9d8 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 16:11:27 -0400 Subject: [PATCH 38/40] Fix tests for #constructor --- ...fields-hash-constructor-is-a-valid-name.js | 40 +++++++++++++++++++ ...fields-string-name-propname-constructor.js | 22 ---------- 2 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 test/language/statements/class/fields-hash-constructor-is-a-valid-name.js delete mode 100644 test/language/statements/class/privatefields-string-name-propname-constructor.js diff --git a/test/language/statements/class/fields-hash-constructor-is-a-valid-name.js b/test/language/statements/class/fields-hash-constructor-is-a-valid-name.js new file mode 100644 index 0000000000..6311234f7d --- /dev/null +++ b/test/language/statements/class/fields-hash-constructor-is-a-valid-name.js @@ -0,0 +1,40 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: "#constructor is a valid property name for a public field" +esid: sec-class-definitions-static-semantics-early-errors +features: [class, class-fields-public] +info: | + ClassElementName : PrivateName; + + It is a Syntax Error if StringValue of PrivateName is "#constructor". +includes: [propertyHelper.js] +---*/ + +class C1 { + ["#constructor"]; +} + +var c1 = new C1(); + +assert.sameValue(Object.prototype.hasOwnProperty.call(C1, '#constructor'), false); +verifyProperty(c1, '#constructor', { + value: undefined, + configurable: true, + enumerable: true, + writable: true, +}); + +class C2 { + ["#constructor"] = 42; +} + +var c2 = new C2(); + +assert.sameValue(Object.prototype.hasOwnProperty.call(C2, '#constructor'), false); +verifyProperty(c2, '#constructor', { + value: 42, + configurable: true, + enumerable: true, + writable: true, +}); diff --git a/test/language/statements/class/privatefields-string-name-propname-constructor.js b/test/language/statements/class/privatefields-string-name-propname-constructor.js deleted file mode 100644 index ab0700a5fc..0000000000 --- a/test/language/statements/class/privatefields-string-name-propname-constructor.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-private] -negative: - phase: parse - type: SyntaxError -info: | - ClassElementName : PrivateName; - - It is a Syntax Error if StringValue of PrivateName is "#constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - ["#constructor"]; -} From dbcd3881546280b6e3324a5e8e3cf1c5e733bf53 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 16:24:37 -0400 Subject: [PATCH 39/40] Remove duplicate of test/language/statements/class/fields-privatename-constructor-err.js --- .../privatefields-propname-constructor.js | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 test/language/statements/class/privatefields-propname-constructor.js diff --git a/test/language/statements/class/privatefields-propname-constructor.js b/test/language/statements/class/privatefields-propname-constructor.js deleted file mode 100644 index 1634ae2edc..0000000000 --- a/test/language/statements/class/privatefields-propname-constructor.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-private] -negative: - phase: parse - type: SyntaxError -info: | - ClassElementName : PrivateName; - - It is a Syntax Error if StringValue of PrivateName is "#constructor". - ----*/ - - -throw "Test262: This statement should not be evaluated."; - -class C { - #constructor; -} From fa36c45083dd90296e5ab54d6d283e1abdf66a04 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Tue, 21 Aug 2018 16:32:10 -0400 Subject: [PATCH 40/40] Fix generated tests --- .../statements/class/fields-computed-name-toprimitive-symbol.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js index b68841fce4..8818450017 100644 --- a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js +++ b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js @@ -62,6 +62,8 @@ var obj3 = { valueOf: function() { return s3; } }; + + class C { [obj1] = 42; [obj2] = 43;