From b3869474c5d04051f1c958d2ba0b428555ca6621 Mon Sep 17 00:00:00 2001 From: Rick Waldron <waldron.rick@gmail.com> Date: Wed, 8 Aug 2018 14:08:18 -0400 Subject: [PATCH] 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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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 + <ZWNJ> <ZWJ> + + UnicodeIDStart:: + any Unicode code point with the Unicode property "ID_Start" + + UnicodeIDContinue:: + any Unicode code point with the Unicode property "ID_Continue" + + + NOTE 3 + The sets of code points with Unicode properties "ID_Start" and + "ID_Continue" include, respectively, the code points with Unicode + properties "Other_ID_Start" and "Other_ID_Continue". + +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); + -- GitLab