diff --git a/src/class-fields/class-evaluation-error/cls-decl.template b/src/class-fields/class-evaluation-error/cls-decl.template new file mode 100644 index 0000000000..2b141c930a --- /dev/null +++ b/src/class-fields/class-evaluation-error/cls-decl.template @@ -0,0 +1,17 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/class/fields-evaluation-error- +name: field definitions in a class declaration +features: [class-fields] +esid: sec-runtime-semantics-classdefinitionevaluation +---*/ + +function evaluate() { + class C { + /*{ fields }*/ + } +} + +assert.throws(/*{ error }*/, evaluate); diff --git a/src/class-fields/class-evaluation-error/cls-expr.template b/src/class-fields/class-evaluation-error/cls-expr.template new file mode 100644 index 0000000000..d7cf4339ac --- /dev/null +++ b/src/class-fields/class-evaluation-error/cls-expr.template @@ -0,0 +1,17 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/expressions/class/fields-evaluation-error- +name: field definitions in a class expression +features: [class-fields] +esid: sec-runtime-semantics-classdefinitionevaluation +---*/ + +function evaluate() { + var C = class { + /*{ fields }*/ + }; +} + +assert.throws(/*{ error }*/, evaluate); diff --git a/src/class-fields/computed-name-referenceerror.case b/src/class-fields/computed-name-referenceerror.case new file mode 100644 index 0000000000..95447eff00 --- /dev/null +++ b/src/class-fields/computed-name-referenceerror.case @@ -0,0 +1,54 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: ReferenceError evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names] +---*/ + +//- setup +function fn() { + throw new Test262Error(); +} + +//- fields +[noRef] = fn(); +//- error +ReferenceError diff --git a/src/class-fields/computed-name-toprimitive-err.case b/src/class-fields/computed-name-toprimitive-err.case new file mode 100644 index 0000000000..07b991c494 --- /dev/null +++ b/src/class-fields/computed-name-toprimitive-err.case @@ -0,0 +1,56 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Custom error evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names, Symbol.toPrimitive] +---*/ + +//- setup +var obj = { + [Symbol.toPrimitive]: function() { + throw new Test262Error(); + } +}; + +//- fields +[obj] +//- error +Test262Error diff --git a/src/class-fields/computed-name-toprimitive-returns-noncallable.js b/src/class-fields/computed-name-toprimitive-returns-noncallable.js new file mode 100644 index 0000000000..6a69776c2a --- /dev/null +++ b/src/class-fields/computed-name-toprimitive-returns-noncallable.js @@ -0,0 +1,55 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Custom error evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names, Symbol.toPrimitive] +---*/ + +//- setup +var obj = { + [Symbol.toPrimitive]: {} +}; + +//- fields +[obj] = refErrorIfEvaluated; +//- error +TypeError + diff --git a/src/class-fields/computed-name-toprimitive-returns-nonobject.js b/src/class-fields/computed-name-toprimitive-returns-nonobject.js new file mode 100644 index 0000000000..0fa3ec95af --- /dev/null +++ b/src/class-fields/computed-name-toprimitive-returns-nonobject.js @@ -0,0 +1,54 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Custom error evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names, Symbol.toPrimitive] +---*/ + +//- setup +var obj = { + [Symbol.toPrimitive]: 42 +}; + +//- fields +[obj] = refErrorIfEvaluated; +//- error +TypeError diff --git a/src/class-fields/computed-name-toprimitive-symbol.case b/src/class-fields/computed-name-toprimitive-symbol.case new file mode 100644 index 0000000000..daee6c76f5 --- /dev/null +++ b/src/class-fields/computed-name-toprimitive-symbol.case @@ -0,0 +1,103 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: ToPrimitive evaluation in the ComputedPropertyName +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: default +features: [computed-property-names, Symbol.toPrimitive, Symbol] +includes: [propertyHelper.js] +---*/ + +//- setup +var s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + +//- fields +[obj1] = 42; +[obj2] = 43; +[obj3] = 44; +//- assertions +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C, s1), false); + +verifyProperty(c, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C, s2), false); + +verifyProperty(c, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); +assert.sameValue(Object.hasOwnProperty.call(C, s3), false); + +verifyProperty(c, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/src/class-fields/computed-name-toprimitive.case b/src/class-fields/computed-name-toprimitive.case new file mode 100644 index 0000000000..a8c859b9c5 --- /dev/null +++ b/src/class-fields/computed-name-toprimitive.case @@ -0,0 +1,100 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: ToPrimitive evaluation in the ComputedPropertyName +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: default +features: [computed-property-names, Symbol.toPrimitive] +includes: [propertyHelper.js] +---*/ + +//- setup +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + +//- fields +[obj1] = 42; +[obj2] = 43; +[obj3] = 44; +//- assertions +var c = new C(); + +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 +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "e"), false); + +verifyProperty(c, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "f"), false); + +verifyProperty(c, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/src/class-fields/computed-name-tostring-err.case b/src/class-fields/computed-name-tostring-err.case new file mode 100644 index 0000000000..b6d81c06b2 --- /dev/null +++ b/src/class-fields/computed-name-tostring-err.case @@ -0,0 +1,57 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Custom error evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names] +---*/ + +//- setup +var obj = { + toString: function() { + throw new Test262Error(); + } +}; + +//- fields +[obj] +//- error +Test262Error + diff --git a/src/class-fields/computed-name-valueof-err.case b/src/class-fields/computed-name-valueof-err.case new file mode 100644 index 0000000000..232e3c1e9e --- /dev/null +++ b/src/class-fields/computed-name-valueof-err.case @@ -0,0 +1,57 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Custom error evaluating a computed property name +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: class-evaluation-error +features: [computed-property-names] +---*/ + +//- setup +var obj = { + toString: undefined, + valueOf: function() { + throw new Test262Error(); + } +}; + +//- fields +[obj] +//- error +Test262Error diff --git a/src/class-fields/computed-names.case b/src/class-fields/computed-names.case index fed153347b..d0ff46c7b0 100644 --- a/src/class-fields/computed-names.case +++ b/src/class-fields/computed-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] features: [computed-property-names] ---*/ diff --git a/src/class-fields/computed-symbol-names.case b/src/class-fields/computed-symbol-names.case index 689840c70a..106bdc4b14 100644 --- a/src/class-fields/computed-symbol-names.case +++ b/src/class-fields/computed-symbol-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] features: [Symbol, computed-property-names] ---*/ diff --git a/src/class-fields/ctor-called-after-fields-init.case b/src/class-fields/ctor-called-after-fields-init.case new file mode 100644 index 0000000000..4ab2253926 --- /dev/null +++ b/src/class-fields/ctor-called-after-fields-init.case @@ -0,0 +1,29 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: The constructor method is called after the fields are initalized +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... +template: default +---*/ + +//- setup +var ctor; +//- fields +constructor() { + ctor = this.foo; +} +foo = 42; +//- assertions +var c = new C(); + +assert.sameValue(ctor, 42); diff --git a/src/class-fields/default/cls-decl.template b/src/class-fields/default/cls-decl.template new file mode 100644 index 0000000000..e46471f6a3 --- /dev/null +++ b/src/class-fields/default/cls-decl.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/class/fields- +name: field definitions in a class declaration +features: [class-fields] +esid: prod-FieldDefinition +---*/ + +class C { + /*{ fields }*/ +} + +/*{ assertions }*/ diff --git a/src/class-fields/default/cls-expr.template b/src/class-fields/default/cls-expr.template new file mode 100644 index 0000000000..5b22f06c8a --- /dev/null +++ b/src/class-fields/default/cls-expr.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/expressions/class/fields- +name: field definitions in a class expression +features: [class-fields] +esid: prod-FieldDefinition +---*/ + +var C = class { + /*{ fields }*/ +} + +/*{ assertions }*/ diff --git a/src/class-fields/error/cls-decl-new-no-sc-line-generator.template b/src/class-fields/error/cls-decl-new-no-sc-line-generator.template deleted file mode 100644 index c7aebcdef8..0000000000 --- a/src/class-fields/error/cls-decl-new-no-sc-line-generator.template +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -/*--- -path: language/statements/class/fields-new-no-sc-line-gen- -name: ASI prevents a following generator method -features: [class-fields, generators] -negative: - type: SyntaxError - phase: early ----*/ - -class C { - /*{ fields }*/ - *m() { return 42; } -} diff --git a/src/class-fields/init-err-evaluation.case b/src/class-fields/init-err-evaluation.case new file mode 100644 index 0000000000..caac1c029d --- /dev/null +++ b/src/class-fields/init-err-evaluation.case @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Return abrupt completion evaluating the field initializer +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... +template: default +---*/ + +//- setup +var x = 0; +function fn1() { x += 1; } +function fn2() { throw new Test262Error(); } +//- fields +x = fn1(); +y = fn2(); +z = fn1(); +//- assertions +assert.throws(Test262Error, function() { + new C(); +}); + +assert.sameValue(x, 1); diff --git a/src/class-fields/init-value-defined-after-class.case b/src/class-fields/init-value-defined-after-class.case new file mode 100644 index 0000000000..51c754c783 --- /dev/null +++ b/src/class-fields/init-value-defined-after-class.case @@ -0,0 +1,45 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: The initializer value is defined after the class evaluation +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... +template: default +features: [computed-property-names] +includes: [propertyHelper.js] +---*/ + +//- setup +var x = false; +//- fields +[x] = x; +//- assertions +var c1 = new C(); + +x = true; +var c2 = new C(); + +verifyProperty(c1, "false", { + value: false, + enumerable: true, + configurable: true, + writable: true, +}); +verifyProperty(c2, "false", { + value: true, + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c1.hasOwnProperty("true"), false); +assert.sameValue(c2.hasOwnProperty("true"), false); diff --git a/src/class-fields/init-value-incremental.case b/src/class-fields/init-value-incremental.case new file mode 100644 index 0000000000..b3cd5a8c08 --- /dev/null +++ b/src/class-fields/init-value-incremental.case @@ -0,0 +1,81 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: The initializer value is defined during the class instatiation +info: | + Runtime Semantics: ClassDefinitionEvaluation + + 27. For each ClassElement e in order from elements + ... + d. Append to fieldRecords the elements of fields. + ... + 33. Let result be InitializeStaticFields(F). + ... + + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... +template: default +features: [computed-property-names] +includes: [propertyHelper.js] +---*/ + +//- setup +var x = 0; +//- fields +static [x++] = x++; +[x++] = x++; +static [x++] = x++; +[x++] = x++; +//- assertions +var c1 = new C(); +var c2 = new C(); + +verifyProperty(C, "0", { + value: 4, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(C, "2", { + value: 5, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "1", { + value: 6, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "3", { + value: 7, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "1", { + value: 8, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "3", { + value: 9, + enumerable: true, + configurable: true, + writable: true, +}); diff --git a/src/class-fields/literal-names.case b/src/class-fields/literal-names.case index 5a78698097..3637efbca2 100644 --- a/src/class-fields/literal-names.case +++ b/src/class-fields/literal-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] ---*/ diff --git a/src/class-fields/private-names.case b/src/class-fields/private-names.case index 6987bcd7b2..24e9a7c2c1 100644 --- a/src/class-fields/private-names.case +++ b/src/class-fields/private-names.case @@ -16,7 +16,7 @@ info: | PrivateName: #IdentifierName -template: default +template: productions ---*/ //- fields diff --git a/src/class-fields/default/cls-decl-after-same-line-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-async-gen.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-async-gen.template rename to src/class-fields/productions/cls-decl-after-same-line-async-gen.template diff --git a/src/class-fields/default/cls-decl-after-same-line-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-async-method.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-async-method.template rename to src/class-fields/productions/cls-decl-after-same-line-async-method.template diff --git a/src/class-fields/default/cls-decl-after-same-line-gen.template b/src/class-fields/productions/cls-decl-after-same-line-gen.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-gen.template rename to src/class-fields/productions/cls-decl-after-same-line-gen.template diff --git a/src/class-fields/default/cls-decl-after-same-line-method.template b/src/class-fields/productions/cls-decl-after-same-line-method.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-method.template rename to src/class-fields/productions/cls-decl-after-same-line-method.template diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-static-async-gen.template rename to src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-method.template b/src/class-fields/productions/cls-decl-after-same-line-static-async-method.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-static-async-method.template rename to src/class-fields/productions/cls-decl-after-same-line-static-async-method.template diff --git a/src/class-fields/default/cls-decl-after-same-line-static-gen.template b/src/class-fields/productions/cls-decl-after-same-line-static-gen.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-static-gen.template rename to src/class-fields/productions/cls-decl-after-same-line-static-gen.template diff --git a/src/class-fields/default/cls-decl-after-same-line-static-method.template b/src/class-fields/productions/cls-decl-after-same-line-static-method.template similarity index 100% rename from src/class-fields/default/cls-decl-after-same-line-static-method.template rename to src/class-fields/productions/cls-decl-after-same-line-static-method.template diff --git a/src/class-fields/default/cls-decl-multiple-definitions.template b/src/class-fields/productions/cls-decl-multiple-definitions.template similarity index 100% rename from src/class-fields/default/cls-decl-multiple-definitions.template rename to src/class-fields/productions/cls-decl-multiple-definitions.template diff --git a/src/class-fields/default/cls-decl-multiple-stacked-definitions.template b/src/class-fields/productions/cls-decl-multiple-stacked-definitions.template similarity index 100% rename from src/class-fields/default/cls-decl-multiple-stacked-definitions.template rename to src/class-fields/productions/cls-decl-multiple-stacked-definitions.template diff --git a/src/class-fields/default/cls-decl-new-no-sc-line-method.template b/src/class-fields/productions/cls-decl-new-no-sc-line-method.template similarity index 100% rename from src/class-fields/default/cls-decl-new-no-sc-line-method.template rename to src/class-fields/productions/cls-decl-new-no-sc-line-method.template diff --git a/src/class-fields/default/cls-decl-new-sc-line-generator.template b/src/class-fields/productions/cls-decl-new-sc-line-generator.template similarity index 100% rename from src/class-fields/default/cls-decl-new-sc-line-generator.template rename to src/class-fields/productions/cls-decl-new-sc-line-generator.template diff --git a/src/class-fields/default/cls-decl-new-sc-line-method.template b/src/class-fields/productions/cls-decl-new-sc-line-method.template similarity index 100% rename from src/class-fields/default/cls-decl-new-sc-line-method.template rename to src/class-fields/productions/cls-decl-new-sc-line-method.template diff --git a/src/class-fields/default/cls-decl-regular-definitions.template b/src/class-fields/productions/cls-decl-regular-definitions.template similarity index 100% rename from src/class-fields/default/cls-decl-regular-definitions.template rename to src/class-fields/productions/cls-decl-regular-definitions.template diff --git a/src/class-fields/default/cls-decl-same-line-generator.template b/src/class-fields/productions/cls-decl-same-line-generator.template similarity index 100% rename from src/class-fields/default/cls-decl-same-line-generator.template rename to src/class-fields/productions/cls-decl-same-line-generator.template diff --git a/src/class-fields/default/cls-decl-same-line-method.template b/src/class-fields/productions/cls-decl-same-line-method.template similarity index 100% rename from src/class-fields/default/cls-decl-same-line-method.template rename to src/class-fields/productions/cls-decl-same-line-method.template diff --git a/src/class-fields/default/cls-decl-wrapped-in-sc.template b/src/class-fields/productions/cls-decl-wrapped-in-sc.template similarity index 100% rename from src/class-fields/default/cls-decl-wrapped-in-sc.template rename to src/class-fields/productions/cls-decl-wrapped-in-sc.template diff --git a/src/class-fields/default/cls-expr-after-same-line-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-async-gen.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-async-gen.template rename to src/class-fields/productions/cls-expr-after-same-line-async-gen.template diff --git a/src/class-fields/default/cls-expr-after-same-line-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-async-method.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-async-method.template rename to src/class-fields/productions/cls-expr-after-same-line-async-method.template diff --git a/src/class-fields/default/cls-expr-after-same-line-gen.template b/src/class-fields/productions/cls-expr-after-same-line-gen.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-gen.template rename to src/class-fields/productions/cls-expr-after-same-line-gen.template diff --git a/src/class-fields/default/cls-expr-after-same-line-method.template b/src/class-fields/productions/cls-expr-after-same-line-method.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-method.template rename to src/class-fields/productions/cls-expr-after-same-line-method.template diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-static-async-gen.template rename to src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-method.template b/src/class-fields/productions/cls-expr-after-same-line-static-async-method.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-static-async-method.template rename to src/class-fields/productions/cls-expr-after-same-line-static-async-method.template diff --git a/src/class-fields/default/cls-expr-after-same-line-static-gen.template b/src/class-fields/productions/cls-expr-after-same-line-static-gen.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-static-gen.template rename to src/class-fields/productions/cls-expr-after-same-line-static-gen.template diff --git a/src/class-fields/default/cls-expr-after-same-line-static-method.template b/src/class-fields/productions/cls-expr-after-same-line-static-method.template similarity index 100% rename from src/class-fields/default/cls-expr-after-same-line-static-method.template rename to src/class-fields/productions/cls-expr-after-same-line-static-method.template diff --git a/src/class-fields/default/cls-expr-multiple-definitions.template b/src/class-fields/productions/cls-expr-multiple-definitions.template similarity index 100% rename from src/class-fields/default/cls-expr-multiple-definitions.template rename to src/class-fields/productions/cls-expr-multiple-definitions.template diff --git a/src/class-fields/default/cls-expr-multiple-stacked-definitions.template b/src/class-fields/productions/cls-expr-multiple-stacked-definitions.template similarity index 100% rename from src/class-fields/default/cls-expr-multiple-stacked-definitions.template rename to src/class-fields/productions/cls-expr-multiple-stacked-definitions.template diff --git a/src/class-fields/default/cls-expr-new-no-sc-line-method.template b/src/class-fields/productions/cls-expr-new-no-sc-line-method.template similarity index 100% rename from src/class-fields/default/cls-expr-new-no-sc-line-method.template rename to src/class-fields/productions/cls-expr-new-no-sc-line-method.template diff --git a/src/class-fields/default/cls-expr-new-sc-line-generator.template b/src/class-fields/productions/cls-expr-new-sc-line-generator.template similarity index 100% rename from src/class-fields/default/cls-expr-new-sc-line-generator.template rename to src/class-fields/productions/cls-expr-new-sc-line-generator.template diff --git a/src/class-fields/default/cls-expr-new-sc-line-method.template b/src/class-fields/productions/cls-expr-new-sc-line-method.template similarity index 100% rename from src/class-fields/default/cls-expr-new-sc-line-method.template rename to src/class-fields/productions/cls-expr-new-sc-line-method.template diff --git a/src/class-fields/default/cls-expr-regular-definitions.template b/src/class-fields/productions/cls-expr-regular-definitions.template similarity index 100% rename from src/class-fields/default/cls-expr-regular-definitions.template rename to src/class-fields/productions/cls-expr-regular-definitions.template diff --git a/src/class-fields/default/cls-expr-same-line-generator.template b/src/class-fields/productions/cls-expr-same-line-generator.template similarity index 100% rename from src/class-fields/default/cls-expr-same-line-generator.template rename to src/class-fields/productions/cls-expr-same-line-generator.template diff --git a/src/class-fields/default/cls-expr-same-line-method.template b/src/class-fields/productions/cls-expr-same-line-method.template similarity index 100% rename from src/class-fields/default/cls-expr-same-line-method.template rename to src/class-fields/productions/cls-expr-same-line-method.template diff --git a/src/class-fields/default/cls-expr-wrapped-in-sc.template b/src/class-fields/productions/cls-expr-wrapped-in-sc.template similarity index 100% rename from src/class-fields/default/cls-expr-wrapped-in-sc.template rename to src/class-fields/productions/cls-expr-wrapped-in-sc.template diff --git a/src/class-fields/redeclaration-symbol.case b/src/class-fields/redeclaration-symbol.case new file mode 100644 index 0000000000..fa2d32ed70 --- /dev/null +++ b/src/class-fields/redeclaration-symbol.case @@ -0,0 +1,52 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Redeclaration of public fields with the same name +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +template: default +includes: [propertyHelper.js, compareArray.js] +---*/ + +//- setup +var x = []; +var y = Symbol(); +//- fields +[y] = (x.push("a"), "old_value"); +[y] = (x.push("b"), "same_value"); +[y] = (x.push("c"), "same_value"); +//- assertions +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); +assert.sameValue(Object.hasOwnProperty.call(C, y), false); + +verifyProperty(c, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); diff --git a/src/class-fields/redeclaration.case b/src/class-fields/redeclaration.case new file mode 100644 index 0000000000..e67c145362 --- /dev/null +++ b/src/class-fields/redeclaration.case @@ -0,0 +1,52 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Redeclaration of public fields with the same name +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +template: default +includes: [propertyHelper.js, compareArray.js] +---*/ + +//- setup +var x = []; +//- fields +y = (x.push("a"), "old_value"); +["y"] = (x.push("b"), "another_value"); +"y" = (x.push("c"), "same_value"); +y = (x.push("d"), "same_value"); +//- assertions +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + +verifyProperty(c, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); diff --git a/src/class-fields/static-computed-name-toprimitive-symbol.case b/src/class-fields/static-computed-name-toprimitive-symbol.case new file mode 100644 index 0000000000..49fc61c491 --- /dev/null +++ b/src/class-fields/static-computed-name-toprimitive-symbol.case @@ -0,0 +1,102 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: ToPrimitive evaluation in the ComputedPropertyName +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: default +features: [computed-property-names, Symbol.toPrimitive, Symbol] +includes: [propertyHelper.js] +---*/ + +//- setup +var s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + +//- fields +static [obj1] = 42; +static [obj2] = 43; +static [obj3] = 44; +//- assertions +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); + +verifyProperty(C, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, s1), false); +assert.sameValue(Object.hasOwnProperty.call(c, s2), false); +assert.sameValue(Object.hasOwnProperty.call(c, s3), false); diff --git a/src/class-fields/static-computed-name-toprimitive.case b/src/class-fields/static-computed-name-toprimitive.case new file mode 100644 index 0000000000..133eff72bd --- /dev/null +++ b/src/class-fields/static-computed-name-toprimitive.case @@ -0,0 +1,99 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: ToPrimitive evaluation in the ComputedPropertyName +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). +template: default +features: [computed-property-names, Symbol.toPrimitive] +includes: [propertyHelper.js] +---*/ + +//- setup +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + +//- fields +static [obj1] = 42; +static [obj2] = 43; +static [obj3] = 44; +//- assertions +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); + +verifyProperty(C, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "f"), false); diff --git a/src/class-fields/static-computed-names.case b/src/class-fields/static-computed-names.case index c1d826c9d8..74fb407b55 100644 --- a/src/class-fields/static-computed-names.case +++ b/src/class-fields/static-computed-names.case @@ -14,7 +14,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] features: [computed-property-names] ---*/ diff --git a/src/class-fields/static-computed-symbol-names.case b/src/class-fields/static-computed-symbol-names.case index be0c75c49f..79ec1284cb 100644 --- a/src/class-fields/static-computed-symbol-names.case +++ b/src/class-fields/static-computed-symbol-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] features: [Symbol, computed-property-names] ---*/ @@ -23,12 +23,12 @@ var x = Symbol(); var y = Symbol(); //- fields -[x]; [y] = 42 +static [x]; static [y] = 42 //- assertions 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -36,9 +36,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/src/class-fields/static-literal-names.case b/src/class-fields/static-literal-names.case index e10ab48546..9fd2327a4b 100644 --- a/src/class-fields/static-literal-names.case +++ b/src/class-fields/static-literal-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] ---*/ diff --git a/src/class-fields/static-private-names.case b/src/class-fields/static-private-names.case index 464b53a9e9..10791399ff 100644 --- a/src/class-fields/static-private-names.case +++ b/src/class-fields/static-private-names.case @@ -16,7 +16,7 @@ info: | PrivateName: #IdentifierName -template: default +template: productions ---*/ //- fields diff --git a/src/class-fields/static-redeclaration-symbol.case b/src/class-fields/static-redeclaration-symbol.case new file mode 100644 index 0000000000..cc811207d7 --- /dev/null +++ b/src/class-fields/static-redeclaration-symbol.case @@ -0,0 +1,47 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Redeclaration of public static fields with the same name +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +template: default +includes: [propertyHelper.js, compareArray.js] +---*/ + +//- setup +var x = []; +var y = Symbol(); +//- fields +static [y] = (x.push("a"), "old_value"); +static [y] = (x.push("b"), "same_value"); +static [y] = (x.push("c"), "same_value"); +//- assertions +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + +verifyProperty(C, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, y), false); + +assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation"); diff --git a/src/class-fields/static-redeclaration.case b/src/class-fields/static-redeclaration.case new file mode 100644 index 0000000000..46bfc9ddd3 --- /dev/null +++ b/src/class-fields/static-redeclaration.case @@ -0,0 +1,47 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: Redeclaration of public static fields with the same name +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +template: default +includes: [propertyHelper.js, compareArray.js] +---*/ + +//- setup +var x = []; +//- fields +static y = (x.push("a"), "old_value"); +static ["y"] = (x.push("b"), "another_value"); +static "y" = (x.push("c"), "same_value"); +static y = (x.push("d"), "same_value"); +//- assertions +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + +verifyProperty(C, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + +assert(compareArray(x, ["a", "b", "c", "d"]), "static fields are not redefined on class instatiation"); diff --git a/src/class-fields/string-literal-names.case b/src/class-fields/string-literal-names.case index 073ce86411..bc22ba9e08 100644 --- a/src/class-fields/string-literal-names.case +++ b/src/class-fields/string-literal-names.case @@ -13,7 +13,7 @@ info: | ClassElementName: PropertyName -template: default +template: productions includes: [propertyHelper.js] ---*/ 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 4b69ab918d..9e58a6259e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Computed property names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 04b88ace7b..780844d06f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Computed property symbol names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 31bfb64751..301c70b2b0 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Literal property names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 ab3cb9939d..26556aa6b3 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js index 950cde0b7d..a9634a241d 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Static Computed property names (field definitions after a generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js index 862006eb8c..8e6670f833 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Static computed property symbol names (field definitions after a generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - *m() { return 42; } [x]; [y] = 42; + *m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js index 8c142d28dc..5d6c2150d7 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: Static literal property names (field definitions after a generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js index 744eb680e2..9dc9e66e47 100644 --- a/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: literal private names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 83f0e3000c..d13199303f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-gen.template /*--- description: String literal names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 315dbf91fc..05634a09a4 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Computed property names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 59fcfd8a8c..6c80a4ce8b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Computed property symbol names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 a41dd10ec5..3a4c92e8cd 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Literal property names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 1a235f8f7c..e2228f86d8 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js index a7b45b5fd5..9e07480520 100644 --- a/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Static Computed property names (field definitions after a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js index 9bc01fb70b..cb2a0b8cbe 100644 --- a/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Static computed property symbol names (field definitions after a method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - m() { return 42; } [x]; [y] = 42; + m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js index 53a5733491..a949cb78a8 100644 --- a/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: Static literal property names (field definitions after a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-method-static-private-names.js index 3ff4c01bd8..1be5b29063 100644 --- a/test/language/expressions/class/fields-after-same-line-method-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: literal private names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 4299b5e823..e87822259f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-method.template +// - src/class-fields/productions/cls-expr-after-same-line-method.template /*--- description: String literal names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 19c7a83737..24c474d7d2 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Computed property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 83fd381d86..f70583c970 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Computed property symbol names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 140c82b712..4869de1319 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Literal property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 4b095a35af..f861963cfc 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js index f82df5a61e..12a2fc26e2 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Static Computed property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js index c2ee765339..6417868e8b 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Static computed property symbol names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - static async *m() { return 42; } [x]; [y] = 42; + static async *m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js index 5abb238d56..1c83c9d8c8 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: Static literal property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js index 8edf7926a5..dea4c29d00 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: literal private names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 6a8912fd79..abfec6f633 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-gen.template /*--- description: String literal names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 e752e8b78b..eb3b3bc6e5 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Computed property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 3c84401887..2dc049dfad 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Computed property symbol names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 e3c2aa56d9..b7bd95df0e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Literal property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 334e99437c..980aaeb44d 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js index 22f43ebd34..e6bd13e379 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Static Computed property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js index 6f560a3b11..fdab32bf28 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Static computed property symbol names (field definitions after a static async method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - static async m() { return 42; } [x]; [y] = 42; + static async m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js index 698af044bd..df0d6c0b5d 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: Static literal property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js index 7b5fe7d5e6..d897837323 100644 --- a/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-async-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: literal private names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 91b742b2ff..7c5b9b4feb 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-async-method.template /*--- description: String literal names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 d5998b97b4..ea238f8c43 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Computed property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 61d79d1619..a999bd70db 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Computed property symbol names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 2211245759..58a549929a 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Literal property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 ae3611c55a..6fc4f7f0af 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js index afc6684050..b1a0840c18 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Static Computed property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js index 352e674277..f2e39fc7ae 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Static computed property symbol names (field definitions after a static generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - static *m() { return 42; } [x]; [y] = 42; + static *m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js index f399ad676c..04ae3ddd3e 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: Static literal property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js index 6b26987857..bfbe8f01d4 100644 --- a/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: literal private names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 9e97ccb68a..5d85381c85 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-static-gen.template /*--- description: String literal names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 63a43adc81..4adfb5fa08 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Computed property names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 7c55fa7561..5f513203c1 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Computed property symbol names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 2dde2d09c1..cc9905b8e5 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Literal property names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 b9fe74b0eb..124c47cbeb 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js index b307989ef2..9c7e097eef 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Static Computed property names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js index cc85063ea9..ba37836fe3 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Static computed property symbol names (field definitions after a static method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - static m() { return 42; } [x]; [y] = 42; + static m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js index 0dc301af6e..b3a08eb916 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: Static literal property names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js b/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js index 6ea4a1ae9f..92c5a19f66 100644 --- a/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js +++ b/test/language/expressions/class/fields-after-same-line-static-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: literal private names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 9478ba2014..9e13601f1f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-static-method.template +// - src/class-fields/productions/cls-expr-after-same-line-static-method.template /*--- description: String literal names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js new file mode 100644 index 0000000000..6798bcd380 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-toprimitive-symbol.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-symbol.case +// - src/class-fields/default/cls-expr.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, Symbol, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + + + +var C = class { + [obj1] = 42; + [obj2] = 43; + [obj3] = 44; +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C, s1), false); + +verifyProperty(c, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C, s2), false); + +verifyProperty(c, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); +assert.sameValue(Object.hasOwnProperty.call(C, s3), false); + +verifyProperty(c, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/expressions/class/fields-computed-name-toprimitive.js b/test/language/expressions/class/fields-computed-name-toprimitive.js new file mode 100644 index 0000000000..aa7186b426 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-toprimitive.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive.case +// - src/class-fields/default/cls-expr.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + + + +var C = class { + [obj1] = 42; + [obj2] = 43; + [obj3] = 44; +} + +var c = new C(); + +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 +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "e"), false); + +verifyProperty(c, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "f"), false); + +verifyProperty(c, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..1f5c86afe6 --- /dev/null +++ b/test/language/expressions/class/fields-ctor-called-after-fields-init.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/ctor-called-after-fields-init.case +// - src/class-fields/default/cls-expr.template +/*--- +description: The constructor method is called after the fields are initalized (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var ctor; + + +var C = class { + constructor() { + ctor = this.foo; + } + foo = 42; +} + +var c = new C(); + +assert.sameValue(ctor, 42); 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 new file mode 100644 index 0000000000..49710f9eb4 --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-referenceerror.case +// - src/class-fields/class-evaluation-error/cls-expr.template +/*--- +description: ReferenceError evaluating a computed property name (field definitions in a class expression) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). + +---*/ +function fn() { + throw new Test262Error(); +} + + + +function evaluate() { + var C = class { + [noRef] = fn(); + }; +} + +assert.throws(ReferenceError, evaluate); 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 new file mode 100644 index 0000000000..9722a5e9ad --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-err.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-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + var C = class { + [obj] + }; +} + +assert.throws(Test262Error, 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 new file mode 100644 index 0000000000..a59c6c19d0 --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-tostring-err.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, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 = { + toString: function() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + var C = class { + [obj] + }; +} + +assert.throws(Test262Error +, evaluate); 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 new file mode 100644 index 0000000000..de04dd3954 --- /dev/null +++ b/test/language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-valueof-err.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, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 = { + toString: undefined, + valueOf: function() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + var C = class { + [obj] + }; +} + +assert.throws(Test262Error, evaluate); diff --git a/test/language/expressions/class/fields-init-err-evaluation.js b/test/language/expressions/class/fields-init-err-evaluation.js new file mode 100644 index 0000000000..00a8d6d037 --- /dev/null +++ b/test/language/expressions/class/fields-init-err-evaluation.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-evaluation.case +// - src/class-fields/default/cls-expr.template +/*--- +description: Return abrupt completion evaluating the field initializer (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = 0; +function fn1() { x += 1; } +function fn2() { throw new Test262Error(); } + + +var C = class { + x = fn1(); + y = fn2(); + z = fn1(); +} + +assert.throws(Test262Error, function() { + new C(); +}); + +assert.sameValue(x, 1); 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 new file mode 100644 index 0000000000..cbf9b0b018 --- /dev/null +++ b/test/language/expressions/class/fields-init-value-defined-after-class.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-value-defined-after-class.case +// - src/class-fields/default/cls-expr.template +/*--- +description: The initializer value is defined after the class evaluation (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = false; + + +var C = class { + [x] = x; +} + +var c1 = new C(); + +x = true; +var c2 = new C(); + +verifyProperty(c1, "false", { + value: false, + enumerable: true, + configurable: true, + writable: true, +}); +verifyProperty(c2, "false", { + value: true, + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c1.hasOwnProperty("true"), false); +assert.sameValue(c2.hasOwnProperty("true"), false); diff --git a/test/language/expressions/class/fields-init-value-incremental.js b/test/language/expressions/class/fields-init-value-incremental.js new file mode 100644 index 0000000000..543d125223 --- /dev/null +++ b/test/language/expressions/class/fields-init-value-incremental.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-value-incremental.case +// - src/class-fields/default/cls-expr.template +/*--- +description: The initializer value is defined during the class instatiation (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + 27. For each ClassElement e in order from elements + ... + d. Append to fieldRecords the elements of fields. + ... + 33. Let result be InitializeStaticFields(F). + ... + + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = 0; + + +var C = class { + static [x++] = x++; + [x++] = x++; + static [x++] = x++; + [x++] = x++; +} + +var c1 = new C(); +var c2 = new C(); + +verifyProperty(C, "0", { + value: 4, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(C, "2", { + value: 5, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "1", { + value: 6, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "3", { + value: 7, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "1", { + value: 8, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "3", { + value: 9, + enumerable: true, + configurable: true, + writable: true, +}); 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 610be4d561..46870180f0 100644 --- a/test/language/expressions/class/fields-multiple-definitions-computed-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Computed property names (multiple fields definitions) esid: prod-FieldDefinition 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 fe316fa767..b970a7ab08 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Computed property symbol names (multiple fields definitions) esid: prod-FieldDefinition 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 efe198d20a..c939159f08 100644 --- a/test/language/expressions/class/fields-multiple-definitions-literal-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Literal property names (multiple fields definitions) esid: prod-FieldDefinition 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 eb90a06ae5..1c98ebe205 100644 --- a/test/language/expressions/class/fields-multiple-definitions-private-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: static literal private names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js index 2666dbfbbf..a5f10f8d53 100644 --- a/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Static Computed property names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js index fad1bd2be6..baafa5f208 100644 --- a/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Static computed property symbol names (multiple fields definitions) esid: prod-FieldDefinition @@ -27,7 +27,7 @@ var y = Symbol(); var C = class { foo = "foobar"; m() { return 42 } - [x]; [y] = 42 + static [x]; static [y] = 42 m2() { return 39 } bar = "barbaz"; @@ -78,9 +78,9 @@ verifyProperty(c, "bar", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -88,9 +88,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js index 2a99b9ceeb..ce3c25c9a7 100644 --- a/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: Static literal property names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-definitions-static-private-names.js b/test/language/expressions/class/fields-multiple-definitions-static-private-names.js index 4239ba3373..bdfe809be6 100644 --- a/test/language/expressions/class/fields-multiple-definitions-static-private-names.js +++ b/test/language/expressions/class/fields-multiple-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: literal private names (multiple fields definitions) esid: prod-FieldDefinition 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 a13a44c26c..97097bdf34 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-multiple-definitions.template +// - src/class-fields/productions/cls-expr-multiple-definitions.template /*--- description: String literal names (multiple fields definitions) esid: prod-FieldDefinition 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 3271e38e3c..8e0f07b86f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Computed property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 e9d610605c..18a70467e2 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Computed property symbol names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 71f21a5f88..96a174bb0e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Literal property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 4e1a7ea269..4f912e83c5 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: static literal private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js index b33aabe334..49a9e29935 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Static Computed property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js index ed8e6280b3..413274ab4b 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Static computed property symbol names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42 + static [x]; static [y] = 42 foo = "foobar" bar = "barbaz"; @@ -56,9 +56,9 @@ verifyProperty(c, "bar", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -66,9 +66,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js index 2c2bcfb46d..56425c0cbf 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: Static literal property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js index 8f1e21b3ea..e9601b9d61 100644 --- a/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js +++ b/test/language/expressions/class/fields-multiple-stacked-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: literal private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 32edf331d7..c82598f1d3 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-expr-multiple-stacked-definitions.template /*--- description: String literal names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 50354308aa..c538990e12 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Computed property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 da7b129ba0..141365de3e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 6b927da89e..b17720408b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Literal property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 da4df0dd32..328530ea62 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js index 09d71d21f2..cf1bd801ac 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js index c4f818aad1..bf3b03b990 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42 + static [x]; static [y] = 42 m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js index 7c6b809956..37beaa5098 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: Static literal property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js index 800cae976c..35d8220560 100644 --- a/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js +++ b/test/language/expressions/class/fields-new-no-sc-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: literal private names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 e79b91f747..1df04d0d38 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-new-no-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-no-sc-line-method.template /*--- description: String literal names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 060487bd3c..921408397b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 1ea70aa907..cced2d331f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 8398577332..8893e08341 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 6e5cb623de..b60ce8c201 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js index 26e4996cdd..c4bb6d5c8c 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js index dadfa266a5..139abf81fe 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42; + static [x]; static [y] = 42; *m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js index 1af95389af..3db5e090ef 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: Static literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js b/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js index 7c5f0694aa..c35d0b6ae5 100644 --- a/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js +++ b/test/language/expressions/class/fields-new-sc-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: literal private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 ac1db02e5e..49ebe2ed7b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-generator.template +// - src/class-fields/productions/cls-expr-new-sc-line-generator.template /*--- description: String literal names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 0c3f140903..a8e93701f1 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 c79e78b692..dfff755ced 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 65211827da..b3cf832ab5 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 2969d1432b..571902a94e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js index bd75e09307..204b8bb9ea 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js index 13884286ad..6e8ffedd2d 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42; + static [x]; static [y] = 42; m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js index bd1f8e580f..ad46b7dac2 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: Static literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js b/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js index d82b8d7d94..2b1c9e0fa2 100644 --- a/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js +++ b/test/language/expressions/class/fields-new-sc-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: literal private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 4848372bc7..ee56fb939f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-new-sc-line-method.template +// - src/class-fields/productions/cls-expr-new-sc-line-method.template /*--- description: String literal names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-redeclaration-symbol.js b/test/language/expressions/class/fields-redeclaration-symbol.js new file mode 100644 index 0000000000..67fcf3c687 --- /dev/null +++ b/test/language/expressions/class/fields-redeclaration-symbol.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/redeclaration-symbol.case +// - src/class-fields/default/cls-expr.template +/*--- +description: Redeclaration of public fields with the same name (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +---*/ +var x = []; +var y = Symbol(); + + +var C = class { + [y] = (x.push("a"), "old_value"); + [y] = (x.push("b"), "same_value"); + [y] = (x.push("c"), "same_value"); +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); +assert.sameValue(Object.hasOwnProperty.call(C, y), false); + +verifyProperty(c, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); diff --git a/test/language/expressions/class/fields-redeclaration.js b/test/language/expressions/class/fields-redeclaration.js new file mode 100644 index 0000000000..400cf22108 --- /dev/null +++ b/test/language/expressions/class/fields-redeclaration.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/redeclaration.case +// - src/class-fields/default/cls-expr.template +/*--- +description: Redeclaration of public fields with the same name (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +---*/ +var x = []; + + +var C = class { + y = (x.push("a"), "old_value"); + ["y"] = (x.push("b"), "another_value"); + "y" = (x.push("c"), "same_value"); + y = (x.push("d"), "same_value"); +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + +verifyProperty(c, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); 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 746b198020..45ccb1fd5a 100644 --- a/test/language/expressions/class/fields-regular-definitions-computed-names.js +++ b/test/language/expressions/class/fields-regular-definitions-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Computed property names (regular fields defintion) esid: prod-FieldDefinition 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 f9b39e52f5..580d7f3688 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Computed property symbol names (regular fields defintion) esid: prod-FieldDefinition 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 e88342eee2..8f9f3e0bb9 100644 --- a/test/language/expressions/class/fields-regular-definitions-literal-names.js +++ b/test/language/expressions/class/fields-regular-definitions-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Literal property names (regular fields defintion) esid: prod-FieldDefinition 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 820c580a80..7e4b0bab96 100644 --- a/test/language/expressions/class/fields-regular-definitions-private-names.js +++ b/test/language/expressions/class/fields-regular-definitions-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: static literal private names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-regular-definitions-static-computed-names.js b/test/language/expressions/class/fields-regular-definitions-static-computed-names.js index 8879a1750c..93aef932ec 100644 --- a/test/language/expressions/class/fields-regular-definitions-static-computed-names.js +++ b/test/language/expressions/class/fields-regular-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Static Computed property names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js b/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js index 29eb4ddfac..4e30b2984d 100644 --- a/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Static computed property symbol names (regular fields defintion) esid: prod-FieldDefinition @@ -25,16 +25,16 @@ var y = Symbol(); var C = class { - [x]; [y] = 42 + static [x]; static [y] = 42 } var c = new C(); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -42,9 +42,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-regular-definitions-static-literal-names.js b/test/language/expressions/class/fields-regular-definitions-static-literal-names.js index fc69466a9f..d541b7a177 100644 --- a/test/language/expressions/class/fields-regular-definitions-static-literal-names.js +++ b/test/language/expressions/class/fields-regular-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: Static literal property names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-regular-definitions-static-private-names.js b/test/language/expressions/class/fields-regular-definitions-static-private-names.js index 7d2f657dd0..15bf4f706a 100644 --- a/test/language/expressions/class/fields-regular-definitions-static-private-names.js +++ b/test/language/expressions/class/fields-regular-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: literal private names (regular fields defintion) esid: prod-FieldDefinition 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 e3c88c0dfd..29d9cb57c4 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-regular-definitions.template +// - src/class-fields/productions/cls-expr-regular-definitions.template /*--- description: String literal names (regular fields defintion) esid: prod-FieldDefinition 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 f408cfc76e..f349ea98ad 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Computed property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 ef71fb51ed..bf0837f77f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Computed property symbol names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 2d319f7076..1c4d82161e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Literal property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 eb7e66892a..6dd71a32d3 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js index cdcef449d9..64c8a527a5 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Static Computed property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js index 05a1577c21..fa3749b0a7 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Static computed property symbol names (field definitions after an async generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - async *m() { return 42; } [x]; [y] = 42; + async *m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C.prototype, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js index 62152bfb5e..6e9a403f49 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: Static literal property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js b/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js index 26ec33b0c3..f4b53fe2f0 100644 --- a/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: literal private names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 e234e6a251..d4e044bd5c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-gen.template +// - src/class-fields/productions/cls-expr-after-same-line-async-gen.template /*--- description: String literal names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 f0c94430fc..203bb2e13d 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Computed property names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 cd350573ef..5770ba5ebb 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Computed property symbol names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 43fe91047f..350684424c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Literal property names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 4c8618391e..db9f61320f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js b/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js index dfbf3851f6..504482b200 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Static Computed property names (field definitions after an async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js index 6582fc2633..5b9362231f 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Static computed property symbol names (field definitions after an async method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - async m() { return 42; } [x]; [y] = 42; + async m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C.prototype, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js b/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js index 7939ee1017..dd9ffc174a 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: Static literal property names (field definitions after an async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-async-method-static-private-names.js b/test/language/expressions/class/fields-same-line-async-method-static-private-names.js index 0268a219e0..3ee8358cb8 100644 --- a/test/language/expressions/class/fields-same-line-async-method-static-private-names.js +++ b/test/language/expressions/class/fields-same-line-async-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: literal private names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 af5eddbfb5..4cc3a30e4e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-after-same-line-async-method.template +// - src/class-fields/productions/cls-expr-after-same-line-async-method.template /*--- description: String literal names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 c67abb3104..0ce592e419 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Computed property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 e9384c0be5..ddc7ac06bf 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Computed property symbol names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 df9d20e47b..9922b866f9 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Literal property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 638c2d7037..2190ae60f9 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-gen-static-computed-names.js b/test/language/expressions/class/fields-same-line-gen-static-computed-names.js index 9b0cc9600e..cba4b5ebbf 100644 --- a/test/language/expressions/class/fields-same-line-gen-static-computed-names.js +++ b/test/language/expressions/class/fields-same-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Static Computed property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js index a01a5ede38..fea6a763a5 100644 --- a/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Static computed property symbol names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42; *m() { return 42; } + static [x]; static [y] = 42; *m() { return 42; } } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-same-line-gen-static-literal-names.js b/test/language/expressions/class/fields-same-line-gen-static-literal-names.js index 91736e5779..7fda39fa3a 100644 --- a/test/language/expressions/class/fields-same-line-gen-static-literal-names.js +++ b/test/language/expressions/class/fields-same-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: Static literal property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-gen-static-private-names.js b/test/language/expressions/class/fields-same-line-gen-static-private-names.js index 35b9cc96df..22681d821c 100644 --- a/test/language/expressions/class/fields-same-line-gen-static-private-names.js +++ b/test/language/expressions/class/fields-same-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: literal private names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 aecc8d8300..980e7b08d6 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-same-line-generator.template +// - src/class-fields/productions/cls-expr-same-line-generator.template /*--- description: String literal names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 198e9c7665..a4a4991fa4 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Computed property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 546335b131..ac626fbc52 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 cb60f45d6d..6b54c7cff7 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Literal property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 dc60f025cc..a61bc9d62f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-method-static-computed-names.js b/test/language/expressions/class/fields-same-line-method-static-computed-names.js index 5930c06f30..e48d3ffcc0 100644 --- a/test/language/expressions/class/fields-same-line-method-static-computed-names.js +++ b/test/language/expressions/class/fields-same-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js b/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js index dd393a37da..0471d35944 100644 --- a/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-same-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); var C = class { - [x]; [y] = 42; m() { return 42; } + static [x]; static [y] = 42; m() { return 42; } } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-same-line-method-static-literal-names.js b/test/language/expressions/class/fields-same-line-method-static-literal-names.js index 2777dc90ca..865035eb7b 100644 --- a/test/language/expressions/class/fields-same-line-method-static-literal-names.js +++ b/test/language/expressions/class/fields-same-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: Static literal property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-same-line-method-static-private-names.js b/test/language/expressions/class/fields-same-line-method-static-private-names.js index 347aed3ede..ec145f68ce 100644 --- a/test/language/expressions/class/fields-same-line-method-static-private-names.js +++ b/test/language/expressions/class/fields-same-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: literal private names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 1f55af229b..7c33c6c85b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-same-line-method.template +// - src/class-fields/productions/cls-expr-same-line-method.template /*--- description: String literal names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js b/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js new file mode 100644 index 0000000000..62208b26cb --- /dev/null +++ b/test/language/expressions/class/fields-static-computed-name-toprimitive-symbol.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-name-toprimitive-symbol.case +// - src/class-fields/default/cls-expr.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, Symbol, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + + + +var C = class { + static [obj1] = 42; + static [obj2] = 43; + static [obj3] = 44; +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); + +verifyProperty(C, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, s1), false); +assert.sameValue(Object.hasOwnProperty.call(c, s2), false); +assert.sameValue(Object.hasOwnProperty.call(c, s3), false); diff --git a/test/language/expressions/class/fields-static-computed-name-toprimitive.js b/test/language/expressions/class/fields-static-computed-name-toprimitive.js new file mode 100644 index 0000000000..cfce643555 --- /dev/null +++ b/test/language/expressions/class/fields-static-computed-name-toprimitive.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-name-toprimitive.case +// - src/class-fields/default/cls-expr.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class expression) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + + + +var C = class { + static [obj1] = 42; + static [obj2] = 43; + static [obj3] = 44; +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); + +verifyProperty(C, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "f"), false); diff --git a/test/language/expressions/class/fields-static-redeclaration-symbol.js b/test/language/expressions/class/fields-static-redeclaration-symbol.js new file mode 100644 index 0000000000..bc2546e963 --- /dev/null +++ b/test/language/expressions/class/fields-static-redeclaration-symbol.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-redeclaration-symbol.case +// - src/class-fields/default/cls-expr.template +/*--- +description: Redeclaration of public static fields with the same name (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +---*/ +var x = []; +var y = Symbol(); + + +var C = class { + static [y] = (x.push("a"), "old_value"); + static [y] = (x.push("b"), "same_value"); + static [y] = (x.push("c"), "same_value"); +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + +verifyProperty(C, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, y), false); + +assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/expressions/class/fields-static-redeclaration.js b/test/language/expressions/class/fields-static-redeclaration.js new file mode 100644 index 0000000000..1c93ba0611 --- /dev/null +++ b/test/language/expressions/class/fields-static-redeclaration.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-redeclaration.case +// - src/class-fields/default/cls-expr.template +/*--- +description: Redeclaration of public static fields with the same name (field definitions in a class expression) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +---*/ +var x = []; + + +var C = class { + static y = (x.push("a"), "old_value"); + static ["y"] = (x.push("b"), "another_value"); + static "y" = (x.push("c"), "same_value"); + static y = (x.push("d"), "same_value"); +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + +verifyProperty(C, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + +assert(compareArray(x, ["a", "b", "c", "d"]), "static fields are not redefined on class instatiation"); 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 2178a39831..4a43e57de0 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Computed property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 7745a0ebe3..c6b74eff53 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Computed property symbol names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 9b6701e6d4..1c4d78e44c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Literal property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 7ddf759a57..bb268effc2 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: static literal private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js index 5a15b36a27..ee6921530e 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Static Computed property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js index 77aec775d4..5961961f99 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Static computed property symbol names (fields definition wrapped in semicolons) esid: prod-FieldDefinition @@ -26,7 +26,7 @@ var y = Symbol(); var C = class { ;;;; - ;;;;;;[x]; [y] = 42;;;;;;; + ;;;;;;static [x]; static [y] = 42;;;;;;; ;;;; } @@ -34,9 +34,9 @@ var C = class { var c = new C(); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -44,9 +44,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js index f9f5bee3cb..f5619cdd90 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: Static literal property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js b/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js index e057d93989..131ef639fb 100644 --- a/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js +++ b/test/language/expressions/class/fields-wrapped-in-sc-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: literal private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 b053d3f2c0..d5e192a78e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-expr-wrapped-in-sc.template +// - src/class-fields/productions/cls-expr-wrapped-in-sc.template /*--- description: String literal names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 2e69fe1de4..191d33ea7d 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Computed property names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 532c5fb81a..df55c55117 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Computed property symbol names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 64b5878a42..c22a4b1cbe 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Literal property names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 2f6cc0ab2a..eb432e7c36 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js index 1714b3e19f..a37ec07b43 100644 --- a/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Static Computed property names (field definitions after a generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js index 8e737374a3..20910ae1be 100644 --- a/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Static computed property symbol names (field definitions after a generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - *m() { return 42; } [x]; [y] = 42; + *m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js index 3eb013c219..631d7f6592 100644 --- a/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: Static literal property names (field definitions after a generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-gen-static-private-names.js index 79c090e06a..661627f28b 100644 --- a/test/language/statements/class/fields-after-same-line-gen-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: literal private names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 f03c5b2625..55ce1dfc4b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-gen.template /*--- description: String literal names (field definitions after a generator in the same line) esid: prod-FieldDefinition 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 b8cce540f3..6c66e7a3f8 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Computed property names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 2c228a4c1f..934a6cc1f2 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Computed property symbol names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 5217248204..385826f04e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Literal property names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 84a25babc2..9bd10b389d 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-method-static-computed-names.js index 131e855153..de016d5171 100644 --- a/test/language/statements/class/fields-after-same-line-method-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Static Computed property names (field definitions after a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js index 0abf67a8f9..d8986e4788 100644 --- a/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Static computed property symbol names (field definitions after a method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - m() { return 42; } [x]; [y] = 42; + m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-method-static-literal-names.js index 1d175ffa47..315870852e 100644 --- a/test/language/statements/class/fields-after-same-line-method-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: Static literal property names (field definitions after a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-method-static-private-names.js index ef4f03a477..707084cf76 100644 --- a/test/language/statements/class/fields-after-same-line-method-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: literal private names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 ec1ead9be5..c9d362c864 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-method.template +// - src/class-fields/productions/cls-decl-after-same-line-method.template /*--- description: String literal names (field definitions after a method in the same line) esid: prod-FieldDefinition 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 5662b1106f..55fc3458b2 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Computed property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 43a25adcb9..16a06780ab 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Computed property symbol names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 06142a248c..412088cfa1 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Literal property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 c4e707fda2..e949295692 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js index 966e0817b0..ff03239681 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Static Computed property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js index bd93cf5b57..63d45a761f 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Static computed property symbol names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - static async *m() { return 42; } [x]; [y] = 42; + static async *m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js index 8aeaec51ac..9f88a2c8be 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: Static literal property names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js index c2ef8a94d4..34ecf2b277 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: literal private names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 e20ea1e276..61c35314e9 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-gen.template /*--- description: String literal names (field definitions after a static async generator in the same line) esid: prod-FieldDefinition 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 18cd384ed0..8b4c8828ca 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Computed property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 ba746b259a..10d9595fda 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Computed property symbol names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 f6491d50e0..d05e864e54 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Literal property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 ae0d2fea0c..f0e0106208 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js index 1903ccd193..848dd7e45b 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Static Computed property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js index 82b80339c0..763490993e 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Static computed property symbol names (field definitions after a static async method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - static async m() { return 42; } [x]; [y] = 42; + static async m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js index 9ee0a2d901..c7259b19e2 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: Static literal property names (field definitions after a static async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js index 85cc98e104..afdd3cbc7d 100644 --- a/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-async-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: literal private names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 25d5739783..4e4711b41b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-async-method.template /*--- description: String literal names (field definitions after a static async method in the same line) esid: prod-FieldDefinition 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 3d3630e5b0..1cdc688a9e 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Computed property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 c4a3ab1b52..77eb19764f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Computed property symbol names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 6cf085ffe3..7d39936750 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Literal property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 270c8daacb..6fd8487403 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js index 6f56849771..a93a128384 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Static Computed property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js index 7c145d15f0..d6c9bec0dd 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Static computed property symbol names (field definitions after a static generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - static *m() { return 42; } [x]; [y] = 42; + static *m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js index b0941f3426..66cf683d2b 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: Static literal property names (field definitions after a static generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js index 09a06f3d5c..627e5a862d 100644 --- a/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: literal private names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 ea9fbf7c29..fbe016345d 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-static-gen.template /*--- description: String literal names (field definitions after a static generator in the same line) esid: prod-FieldDefinition 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 fc7b80248f..d886022dab 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Computed property names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 f20707ab32..dcccd17c67 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Computed property symbol names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 32dffcf65e..5a20003744 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Literal property names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 386a9c6ef8..9d673aec19 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js index 09196da792..440e83c188 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Static Computed property names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js index 4f1f908b91..74a88b2fb8 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Static computed property symbol names (field definitions after a static method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - static m() { return 42; } [x]; [y] = 42; + static m() { return 42; } static [x]; static [y] = 42; } @@ -42,9 +42,9 @@ verifyProperty(C, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js index 92978d97c5..b14e3ec076 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: Static literal property names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js b/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js index 5f0dbb7794..1e9f37a9f9 100644 --- a/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js +++ b/test/language/statements/class/fields-after-same-line-static-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: literal private names (field definitions after a static method in the same line) esid: prod-FieldDefinition 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 7d9ff3f5cf..bed239d467 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-static-method.template +// - src/class-fields/productions/cls-decl-after-same-line-static-method.template /*--- description: String literal names (field definitions after a static method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js new file mode 100644 index 0000000000..30a143d732 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-toprimitive-symbol.js @@ -0,0 +1,106 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-symbol.case +// - src/class-fields/default/cls-decl.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, Symbol, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + + + +class C { + [obj1] = 42; + [obj2] = 43; + [obj3] = 44; +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C, s1), false); + +verifyProperty(c, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C, s2), false); + +verifyProperty(c, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); +assert.sameValue(Object.hasOwnProperty.call(C, s3), false); + +verifyProperty(c, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); diff --git a/test/language/statements/class/fields-computed-name-toprimitive.js b/test/language/statements/class/fields-computed-name-toprimitive.js new file mode 100644 index 0000000000..1694994854 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-toprimitive.js @@ -0,0 +1,103 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive.case +// - src/class-fields/default/cls-decl.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + + + +class C { + [obj1] = 42; + [obj2] = 43; + [obj3] = 44; +} + +var c = new C(); + +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 +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "e"), false); + +verifyProperty(c, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "f"), false); + +verifyProperty(c, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); 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 new file mode 100644 index 0000000000..08ca1bf801 --- /dev/null +++ b/test/language/statements/class/fields-ctor-called-after-fields-init.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/ctor-called-after-fields-init.case +// - src/class-fields/default/cls-decl.template +/*--- +description: The constructor method is called after the fields are initalized (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var ctor; + + +class C { + constructor() { + ctor = this.foo; + } + foo = 42; +} + +var c = new C(); + +assert.sameValue(ctor, 42); 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 new file mode 100644 index 0000000000..9ff6042149 --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-referenceerror.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-referenceerror.case +// - src/class-fields/class-evaluation-error/cls-decl.template +/*--- +description: ReferenceError evaluating a computed property name (field definitions in a class declaration) +esid: sec-runtime-semantics-classdefinitionevaluation +features: [computed-property-names, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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). + +---*/ +function fn() { + throw new Test262Error(); +} + + + +function evaluate() { + class C { + [noRef] = fn(); + } +} + +assert.throws(ReferenceError, evaluate); 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 new file mode 100644 index 0000000000..14a6522df5 --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-toprimitive-err.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-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + class C { + [obj] + } +} + +assert.throws(Test262Error, 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 new file mode 100644 index 0000000000..ca38dd5b08 --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-tostring-err.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-tostring-err.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, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 = { + toString: function() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + class C { + [obj] + } +} + +assert.throws(Test262Error +, evaluate); 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 new file mode 100644 index 0000000000..757d9d536a --- /dev/null +++ b/test/language/statements/class/fields-evaluation-error-computed-name-valueof-err.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/computed-name-valueof-err.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, class-fields] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 = { + toString: undefined, + valueOf: function() { + throw new Test262Error(); + } +}; + + + +function evaluate() { + class C { + [obj] + } +} + +assert.throws(Test262Error, evaluate); diff --git a/test/language/statements/class/fields-init-err-evaluation.js b/test/language/statements/class/fields-init-err-evaluation.js new file mode 100644 index 0000000000..016fd1d52a --- /dev/null +++ b/test/language/statements/class/fields-init-err-evaluation.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-err-evaluation.case +// - src/class-fields/default/cls-decl.template +/*--- +description: Return abrupt completion evaluating the field initializer (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = 0; +function fn1() { x += 1; } +function fn2() { throw new Test262Error(); } + + +class C { + x = fn1(); + y = fn2(); + z = fn1(); +} + +assert.throws(Test262Error, function() { + new C(); +}); + +assert.sameValue(x, 1); 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 new file mode 100644 index 0000000000..02c6c1b1a8 --- /dev/null +++ b/test/language/statements/class/fields-init-value-defined-after-class.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-value-defined-after-class.case +// - src/class-fields/default/cls-decl.template +/*--- +description: The initializer value is defined after the class evaluation (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = false; + + +class C { + [x] = x; +} + +var c1 = new C(); + +x = true; +var c2 = new C(); + +verifyProperty(c1, "false", { + value: false, + enumerable: true, + configurable: true, + writable: true, +}); +verifyProperty(c2, "false", { + value: true, + enumerable: true, + configurable: true, + writable: true, +}); + +assert.sameValue(c1.hasOwnProperty("true"), false); +assert.sameValue(c2.hasOwnProperty("true"), false); diff --git a/test/language/statements/class/fields-init-value-incremental.js b/test/language/statements/class/fields-init-value-incremental.js new file mode 100644 index 0000000000..69b3aa6173 --- /dev/null +++ b/test/language/statements/class/fields-init-value-incremental.js @@ -0,0 +1,84 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/init-value-incremental.case +// - src/class-fields/default/cls-decl.template +/*--- +description: The initializer value is defined during the class instatiation (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, class-fields] +flags: [generated] +includes: [propertyHelper.js] +info: | + Runtime Semantics: ClassDefinitionEvaluation + + 27. For each ClassElement e in order from elements + ... + d. Append to fieldRecords the elements of fields. + ... + 33. Let result be InitializeStaticFields(F). + ... + + [[Construct]] ( argumentsList, newTarget) + + 8. If kind is "base", then + a. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument). + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + ... + 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList). + ... + +---*/ +var x = 0; + + +class C { + static [x++] = x++; + [x++] = x++; + static [x++] = x++; + [x++] = x++; +} + +var c1 = new C(); +var c2 = new C(); + +verifyProperty(C, "0", { + value: 4, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(C, "2", { + value: 5, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "1", { + value: 6, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c1, "3", { + value: 7, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "1", { + value: 8, + enumerable: true, + configurable: true, + writable: true, +}); + +verifyProperty(c2, "3", { + value: 9, + enumerable: true, + configurable: true, + writable: true, +}); 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 4294f2c25e..3785187066 100644 --- a/test/language/statements/class/fields-multiple-definitions-computed-names.js +++ b/test/language/statements/class/fields-multiple-definitions-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Computed property names (multiple fields definitions) esid: prod-FieldDefinition 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 b7be8668b9..be6f4eafcc 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Computed property symbol names (multiple fields definitions) esid: prod-FieldDefinition 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 9dc40ee6e0..9a6c095ca4 100644 --- a/test/language/statements/class/fields-multiple-definitions-literal-names.js +++ b/test/language/statements/class/fields-multiple-definitions-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Literal property names (multiple fields definitions) esid: prod-FieldDefinition 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 60a16a1a39..49137a5220 100644 --- a/test/language/statements/class/fields-multiple-definitions-private-names.js +++ b/test/language/statements/class/fields-multiple-definitions-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: static literal private names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-names.js index 944e702051..fd284a1505 100644 --- a/test/language/statements/class/fields-multiple-definitions-static-computed-names.js +++ b/test/language/statements/class/fields-multiple-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Static Computed property names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js index c3b178ad60..fa3249a63d 100644 --- a/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Static computed property symbol names (multiple fields definitions) esid: prod-FieldDefinition @@ -27,7 +27,7 @@ var y = Symbol(); class C { foo = "foobar"; m() { return 42 } - [x]; [y] = 42 + static [x]; static [y] = 42 m2() { return 39 } bar = "barbaz"; @@ -78,9 +78,9 @@ verifyProperty(c, "bar", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -88,9 +88,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-multiple-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-definitions-static-literal-names.js index 8d3da71b39..fcce13524b 100644 --- a/test/language/statements/class/fields-multiple-definitions-static-literal-names.js +++ b/test/language/statements/class/fields-multiple-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: Static literal property names (multiple fields definitions) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-definitions-static-private-names.js b/test/language/statements/class/fields-multiple-definitions-static-private-names.js index 83abefaf55..269eb2da9a 100644 --- a/test/language/statements/class/fields-multiple-definitions-static-private-names.js +++ b/test/language/statements/class/fields-multiple-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: literal private names (multiple fields definitions) esid: prod-FieldDefinition 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 c8942f783b..89e6745482 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-multiple-definitions.template +// - src/class-fields/productions/cls-decl-multiple-definitions.template /*--- description: String literal names (multiple fields definitions) esid: prod-FieldDefinition 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 bc6141881d..8f30b92b60 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Computed property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 d25cd00868..6d29a5804f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Computed property symbol names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 e2c3689cb9..7f804dbc50 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Literal property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 9527dbaa5c..0aa16299ba 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: static literal private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js index b87ec755f9..a5cba73565 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Static Computed property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js index 4d82de70d5..c00c63eae4 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Static computed property symbol names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42 + static [x]; static [y] = 42 foo = "foobar" bar = "barbaz"; @@ -56,9 +56,9 @@ verifyProperty(c, "bar", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -66,9 +66,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js index a9b1304004..c022d9da95 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: Static literal property names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js index 565165da4b..e62a240363 100644 --- a/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js +++ b/test/language/statements/class/fields-multiple-stacked-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: literal private names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 84d3f59529..935d0c8b3a 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-multiple-stacked-definitions.template +// - src/class-fields/productions/cls-decl-multiple-stacked-definitions.template /*--- description: String literal names (multiple stacked fields definitions through ASI) esid: prod-FieldDefinition 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 239282f2b3..f3aec9048c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Computed property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 9b9590ba8e..4e026e0441 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 e5cdf9402b..491124ad51 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Literal property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 55a5aa7635..de82858d81 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js index 79f6a88fef..6aa47e5f67 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js index a90c7a4455..a7470fff19 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42 + static [x]; static [y] = 42 m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js index 98f7c9aa88..ed5332d92e 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: Static literal property names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js b/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js index 33edc6e0a8..225f47f155 100644 --- a/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js +++ b/test/language/statements/class/fields-new-no-sc-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: literal private names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 99d49b49cb..dd2fe2ba56 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-new-no-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-no-sc-line-method.template /*--- description: String literal names (field definitions followed by a method in a new line without a semicolon) esid: prod-FieldDefinition 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 493a327787..946a3baece 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 83ec80c1d2..7e1fe2e9f4 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 724fdf9bfe..b85f07f025 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 8b4b1175e6..1e413c36b8 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js index 28d063451e..7c4e532d44 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js index e4bf73ea61..afbf5546b1 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42; + static [x]; static [y] = 42; *m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js index d29d2e04e0..b2e90d5807 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: Static literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js b/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js index d2d4423de1..c277f658f6 100644 --- a/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js +++ b/test/language/statements/class/fields-new-sc-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: literal private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 8e6ba68c54..3c208f393f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-generator.template +// - src/class-fields/productions/cls-decl-new-sc-line-generator.template /*--- description: String literal names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 f7fe3f3365..48f29f0e44 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 51d944e0bd..44fee8284b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 1b48da7ba0..f39940f926 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 9be8323397..021ccb3bda 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js b/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js index 4dc70efe93..24058524aa 100644 --- a/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js index 9bcf7aaa0f..d21b53adf8 100644 --- a/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42; + static [x]; static [y] = 42; m() { return 42; } } @@ -43,9 +43,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -53,9 +53,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js b/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js index 577d066624..b40af24dbe 100644 --- a/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: Static literal property names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-new-sc-line-method-static-private-names.js b/test/language/statements/class/fields-new-sc-line-method-static-private-names.js index 2c35e7108f..c8fb0633f6 100644 --- a/test/language/statements/class/fields-new-sc-line-method-static-private-names.js +++ b/test/language/statements/class/fields-new-sc-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: literal private names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition 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 bcf19587a6..0628ca0f6c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-new-sc-line-method.template +// - src/class-fields/productions/cls-decl-new-sc-line-method.template /*--- description: String literal names (field definitions followed by a method in a new line with a semicolon) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-redeclaration-symbol.js b/test/language/statements/class/fields-redeclaration-symbol.js new file mode 100644 index 0000000000..8f623b6082 --- /dev/null +++ b/test/language/statements/class/fields-redeclaration-symbol.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/redeclaration-symbol.case +// - src/class-fields/default/cls-decl.template +/*--- +description: Redeclaration of public fields with the same name (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +---*/ +var x = []; +var y = Symbol(); + + +class C { + [y] = (x.push("a"), "old_value"); + [y] = (x.push("b"), "same_value"); + [y] = (x.push("c"), "same_value"); +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); +assert.sameValue(Object.hasOwnProperty.call(C, y), false); + +verifyProperty(c, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); diff --git a/test/language/statements/class/fields-redeclaration.js b/test/language/statements/class/fields-redeclaration.js new file mode 100644 index 0000000000..1b16dc01ee --- /dev/null +++ b/test/language/statements/class/fields-redeclaration.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/redeclaration.case +// - src/class-fields/default/cls-decl.template +/*--- +description: Redeclaration of public fields with the same name (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + + 2.14 [[Construct]] ( argumentsList, newTarget) + + ... + 8. If kind is "base", then + ... + b. Let result be InitializeInstanceFields(thisArgument, F). + ... + + 2.9 InitializeInstanceFields ( O, constructor ) + + 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). + +---*/ +var x = []; + + +class C { + y = (x.push("a"), "old_value"); + ["y"] = (x.push("b"), "another_value"); + "y" = (x.push("c"), "same_value"); + y = (x.push("d"), "same_value"); +} + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); + +verifyProperty(c, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); 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 0e85698b39..cb357d7882 100644 --- a/test/language/statements/class/fields-regular-definitions-computed-names.js +++ b/test/language/statements/class/fields-regular-definitions-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Computed property names (regular fields defintion) esid: prod-FieldDefinition 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 683a6ccef3..aecb50ff95 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Computed property symbol names (regular fields defintion) esid: prod-FieldDefinition 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 0782d14a99..d219f31273 100644 --- a/test/language/statements/class/fields-regular-definitions-literal-names.js +++ b/test/language/statements/class/fields-regular-definitions-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Literal property names (regular fields defintion) esid: prod-FieldDefinition 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 7e4651ab3c..2f93a8e03d 100644 --- a/test/language/statements/class/fields-regular-definitions-private-names.js +++ b/test/language/statements/class/fields-regular-definitions-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: static literal private names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-regular-definitions-static-computed-names.js b/test/language/statements/class/fields-regular-definitions-static-computed-names.js index ae920aa497..62fd0e9d39 100644 --- a/test/language/statements/class/fields-regular-definitions-static-computed-names.js +++ b/test/language/statements/class/fields-regular-definitions-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Static Computed property names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js b/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js index c385f74158..69a3fe4e73 100644 --- a/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-regular-definitions-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Static computed property symbol names (regular fields defintion) esid: prod-FieldDefinition @@ -25,16 +25,16 @@ var y = Symbol(); class C { - [x]; [y] = 42 + static [x]; static [y] = 42 } var c = new C(); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -42,9 +42,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-regular-definitions-static-literal-names.js b/test/language/statements/class/fields-regular-definitions-static-literal-names.js index 0a5bd05aac..71ff94cd1c 100644 --- a/test/language/statements/class/fields-regular-definitions-static-literal-names.js +++ b/test/language/statements/class/fields-regular-definitions-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: Static literal property names (regular fields defintion) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-regular-definitions-static-private-names.js b/test/language/statements/class/fields-regular-definitions-static-private-names.js index 7ba1403474..2c66173b31 100644 --- a/test/language/statements/class/fields-regular-definitions-static-private-names.js +++ b/test/language/statements/class/fields-regular-definitions-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: literal private names (regular fields defintion) esid: prod-FieldDefinition 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 1a445b4a73..87424e4ef9 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-regular-definitions.template +// - src/class-fields/productions/cls-decl-regular-definitions.template /*--- description: String literal names (regular fields defintion) esid: prod-FieldDefinition 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 ac8cacad70..7e57463aea 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Computed property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 9852dfbc48..564fcccddf 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Computed property symbol names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 ec2409554d..09ec4aa285 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Literal property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 faa11d95ae..dc9fa95ba6 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js b/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js index bfb5649172..1fef76a028 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Static Computed property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js index b4ef5d8038..888a4254aa 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Static computed property symbol names (field definitions after an async generator in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - async *m() { return 42; } [x]; [y] = 42; + async *m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C.prototype, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js b/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js index cffbe5f17a..d6edc9adc3 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: Static literal property names (field definitions after an async generator in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-gen-static-private-names.js b/test/language/statements/class/fields-same-line-async-gen-static-private-names.js index 3bb32d69a4..137c63411c 100644 --- a/test/language/statements/class/fields-same-line-async-gen-static-private-names.js +++ b/test/language/statements/class/fields-same-line-async-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: literal private names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 2c243305c4..dbd1e54349 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-gen.template +// - src/class-fields/productions/cls-decl-after-same-line-async-gen.template /*--- description: String literal names (field definitions after an async generator in the same line) esid: prod-FieldDefinition 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 f0c5c73381..7019911d65 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Computed property names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 efec870e33..356272939c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Computed property symbol names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 7c0ceceef3..38171cd761 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Literal property names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 ad89c93006..be1f0562fe 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-method-static-computed-names.js b/test/language/statements/class/fields-same-line-async-method-static-computed-names.js index 10e9395f7f..d4d24c246e 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-computed-names.js +++ b/test/language/statements/class/fields-same-line-async-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Static Computed property names (field definitions after an async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js index 972b4d1ada..48c781f4eb 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Static computed property symbol names (field definitions after an async method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - async m() { return 42; } [x]; [y] = 42; + async m() { return 42; } static [x]; static [y] = 42; } @@ -41,9 +41,9 @@ verifyProperty(C.prototype, "m", { }, {restore: 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -51,9 +51,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-same-line-async-method-static-literal-names.js b/test/language/statements/class/fields-same-line-async-method-static-literal-names.js index 222b543ea3..0443ffe0cb 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-literal-names.js +++ b/test/language/statements/class/fields-same-line-async-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: Static literal property names (field definitions after an async method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-async-method-static-private-names.js b/test/language/statements/class/fields-same-line-async-method-static-private-names.js index 3e739c6836..dbbc0f0303 100644 --- a/test/language/statements/class/fields-same-line-async-method-static-private-names.js +++ b/test/language/statements/class/fields-same-line-async-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: literal private names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 41a045c951..cad2ee6605 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-after-same-line-async-method.template +// - src/class-fields/productions/cls-decl-after-same-line-async-method.template /*--- description: String literal names (field definitions after an async method in the same line) esid: prod-FieldDefinition 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 1cd7bf8ac5..a8e1d6f071 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Computed property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 976730d9ec..fa7d3163c7 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Computed property symbol names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 38ee4803e4..f11e80436f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Literal property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 d2b1f309ff..28322bf60a 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-gen-static-computed-names.js b/test/language/statements/class/fields-same-line-gen-static-computed-names.js index 4d5bb30a57..1676f0f340 100644 --- a/test/language/statements/class/fields-same-line-gen-static-computed-names.js +++ b/test/language/statements/class/fields-same-line-gen-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Static Computed property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js index 49c4af92ec..6b4f64e8b7 100644 --- a/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-gen-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Static computed property symbol names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42; *m() { return 42; } + static [x]; static [y] = 42; *m() { return 42; } } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-same-line-gen-static-literal-names.js b/test/language/statements/class/fields-same-line-gen-static-literal-names.js index 13c4a74778..2cbe1a6a24 100644 --- a/test/language/statements/class/fields-same-line-gen-static-literal-names.js +++ b/test/language/statements/class/fields-same-line-gen-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: Static literal property names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-gen-static-private-names.js b/test/language/statements/class/fields-same-line-gen-static-private-names.js index ac151d626c..6b8d2331ea 100644 --- a/test/language/statements/class/fields-same-line-gen-static-private-names.js +++ b/test/language/statements/class/fields-same-line-gen-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: literal private names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 b5fedce627..11c736680a 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-same-line-generator.template +// - src/class-fields/productions/cls-decl-same-line-generator.template /*--- description: String literal names (field definitions followed by a generator method in the same line) esid: prod-FieldDefinition 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 19b7c975c8..e77aaa6a3f 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Computed property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 97a65e7392..b9193c81c7 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Computed property symbol names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 1a21e559ba..5bcd714b44 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Literal property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 5c731f9c52..92016818b7 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - 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) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-method-static-computed-names.js b/test/language/statements/class/fields-same-line-method-static-computed-names.js index cf05838969..8f4e88dd93 100644 --- a/test/language/statements/class/fields-same-line-method-static-computed-names.js +++ b/test/language/statements/class/fields-same-line-method-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Static Computed property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js b/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js index 5178507b42..ecb50a7622 100644 --- a/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-same-line-method-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Static computed property symbol names (field definitions followed by a method in the same line) esid: prod-FieldDefinition @@ -25,7 +25,7 @@ var y = Symbol(); class C { - [x]; [y] = 42; m() { return 42; } + static [x]; static [y] = 42; m() { return 42; } } @@ -42,9 +42,9 @@ verifyProperty(C.prototype, "m", { }); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -52,9 +52,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-same-line-method-static-literal-names.js b/test/language/statements/class/fields-same-line-method-static-literal-names.js index c31274b022..6880744140 100644 --- a/test/language/statements/class/fields-same-line-method-static-literal-names.js +++ b/test/language/statements/class/fields-same-line-method-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: Static literal property names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-same-line-method-static-private-names.js b/test/language/statements/class/fields-same-line-method-static-private-names.js index 73b5a0e554..0a862faf1c 100644 --- a/test/language/statements/class/fields-same-line-method-static-private-names.js +++ b/test/language/statements/class/fields-same-line-method-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: literal private names (field definitions followed by a method in the same line) esid: prod-FieldDefinition 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 a80773cc03..2f4b901a53 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-same-line-method.template +// - src/class-fields/productions/cls-decl-same-line-method.template /*--- description: String literal names (field definitions followed by a method in the same line) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js b/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js new file mode 100644 index 0000000000..a4517c5982 --- /dev/null +++ b/test/language/statements/class/fields-static-computed-name-toprimitive-symbol.js @@ -0,0 +1,105 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-name-toprimitive-symbol.case +// - src/class-fields/default/cls-decl.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, Symbol, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 s1 = Symbol(); +var s2 = Symbol(); +var s3 = Symbol(); +var err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return s1; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return s2; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return s3; } +}; + + + +class C { + static [obj1] = 42; + static [obj2] = 43; + static [obj3] = 44; +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s1), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s2), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, s3), false); + +verifyProperty(C, s1, { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s2, { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, s3, { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, s1), false); +assert.sameValue(Object.hasOwnProperty.call(c, s2), false); +assert.sameValue(Object.hasOwnProperty.call(c, s3), false); diff --git a/test/language/statements/class/fields-static-computed-name-toprimitive.js b/test/language/statements/class/fields-static-computed-name-toprimitive.js new file mode 100644 index 0000000000..e965668903 --- /dev/null +++ b/test/language/statements/class/fields-static-computed-name-toprimitive.js @@ -0,0 +1,102 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-computed-name-toprimitive.case +// - src/class-fields/default/cls-decl.template +/*--- +description: ToPrimitive evaluation in the ComputedPropertyName (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [computed-property-names, Symbol.toPrimitive, class-fields] +flags: [generated] +includes: [propertyHelper.js] +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: static FieldDefinition; + Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. + + 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 err = function() { throw new Test262Error(); }; +var obj1 = { + [Symbol.toPrimitive]: function() { return "d"; }, + toString: err, + valueOf: err +}; + +var obj2 = { + toString: function() { return "e"; }, + valueOf: err +}; + +var obj3 = { + toString: undefined, + valueOf: function() { return "f"; } +}; + + + +class C { + static [obj1] = 42; + static [obj2] = 43; + static [obj3] = 44; +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "f"), false); + +verifyProperty(C, "d", { + value: 42, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "e", { + value: 43, + enumerable: true, + writable: true, + configurable: true +}); + +verifyProperty(C, "f", { + value: 44, + enumerable: true, + writable: true, + configurable: true +}); + +var c = new C(); + +assert.sameValue(Object.hasOwnProperty.call(c, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "e"), false); +assert.sameValue(Object.hasOwnProperty.call(c, "f"), false); diff --git a/test/language/statements/class/fields-static-redeclaration-symbol.js b/test/language/statements/class/fields-static-redeclaration-symbol.js new file mode 100644 index 0000000000..9c80524928 --- /dev/null +++ b/test/language/statements/class/fields-static-redeclaration-symbol.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-redeclaration-symbol.case +// - src/class-fields/default/cls-decl.template +/*--- +description: Redeclaration of public static fields with the same name (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +---*/ +var x = []; +var y = Symbol(); + + +class C { + static [y] = (x.push("a"), "old_value"); + static [y] = (x.push("b"), "same_value"); + static [y] = (x.push("c"), "same_value"); +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); + +verifyProperty(C, y, { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, y), false); + +assert(compareArray(x, ["a", "b", "c"]), "static fields are not redefined on class instatiation"); diff --git a/test/language/statements/class/fields-static-redeclaration.js b/test/language/statements/class/fields-static-redeclaration.js new file mode 100644 index 0000000000..f3271daecb --- /dev/null +++ b/test/language/statements/class/fields-static-redeclaration.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-redeclaration.case +// - src/class-fields/default/cls-decl.template +/*--- +description: Redeclaration of public static fields with the same name (field definitions in a class declaration) +esid: prod-FieldDefinition +features: [class-fields] +flags: [generated] +includes: [propertyHelper.js, compareArray.js] +info: | + 2.13.2 Runtime Semantics: ClassDefinitionEvaluation + + ... + 30. Set the value of F's [[Fields]] internal slot to fieldRecords. + ... + 33. Let result be InitializeStaticFields(F). + + InitializeStaticFields(F) + + 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). + +---*/ +var x = []; + + +class C { + static y = (x.push("a"), "old_value"); + static ["y"] = (x.push("b"), "another_value"); + static "y" = (x.push("c"), "same_value"); + static y = (x.push("d"), "same_value"); +} + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); + +verifyProperty(C, "y", { + value: "same_value", + enumerable: true, + writable: true, + configurable: true +}); + +assert(compareArray(x, ["a", "b", "c", "d"])); + +var c = new C(); +assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); + +assert(compareArray(x, ["a", "b", "c", "d"]), "static fields are not redefined on class instatiation"); 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 c550ee442e..b9976d643b 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Computed property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 b1479ba393..e7991f3cf6 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/computed-symbol-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Computed property symbol names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 44a9e1dbeb..cf6e06cd4c 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/literal-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Literal property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 9ee3926476..7732901b67 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/private-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: static literal private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js index 4a315dec74..aca693dc47 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-computed-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Static Computed property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js index e86fb600cc..3ba23c0da6 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-computed-symbol-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Static computed property symbol names (fields definition wrapped in semicolons) esid: prod-FieldDefinition @@ -26,7 +26,7 @@ var y = Symbol(); class C { ;;;; - ;;;;;;[x]; [y] = 42;;;;;;; + ;;;;;;static [x]; static [y] = 42;;;;;;; ;;;; } @@ -34,9 +34,9 @@ class C { var c = new C(); 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); -verifyProperty(c, x, { +verifyProperty(C, x, { value: undefined, enumerable: true, writable: true, @@ -44,9 +44,9 @@ verifyProperty(c, x, { }); 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); -verifyProperty(c, y, { +verifyProperty(C, y, { value: 42, enumerable: true, writable: true, diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js index 71170aa351..1213491703 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-literal-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-literal-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: Static literal property names (fields definition wrapped in semicolons) esid: prod-FieldDefinition diff --git a/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js b/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js index 046949b3ac..cba691dc1c 100644 --- a/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js +++ b/test/language/statements/class/fields-wrapped-in-sc-static-private-names.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/static-private-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: literal private names (fields definition wrapped in semicolons) esid: prod-FieldDefinition 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 84d6729682..fb29419490 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 @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/string-literal-names.case -// - src/class-fields/default/cls-decl-wrapped-in-sc.template +// - src/class-fields/productions/cls-decl-wrapped-in-sc.template /*--- description: String literal names (fields definition wrapped in semicolons) esid: prod-FieldDefinition