diff --git a/src/class-fields/computed-name-referenceerror.case b/src/class-fields/computed-name-referenceerror.case index 95447eff007653c9f2d7c0467631219d54cbcd35..6717a2889e63b2d988f94cc5d7fecdccd7a4358d 100644 --- a/src/class-fields/computed-name-referenceerror.case +++ b/src/class-fields/computed-name-referenceerror.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-toprimitive-err.case b/src/class-fields/computed-name-toprimitive-err.case index 07b991c4948c91ad5190d4a460a38d9ac1752754..026d93f78b97b09b455c26031d3f874bf7a7fea9 100644 --- a/src/class-fields/computed-name-toprimitive-err.case +++ b/src/class-fields/computed-name-toprimitive-err.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-toprimitive-returns-noncallable.js b/src/class-fields/computed-name-toprimitive-returns-noncallable.js index 6a69776c2a30f44454fa2e9137854fd267556ccc..0a45416baea7f3bfa85c8b78baa392ac080146bb 100644 --- a/src/class-fields/computed-name-toprimitive-returns-noncallable.js +++ b/src/class-fields/computed-name-toprimitive-returns-noncallable.js @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-toprimitive-returns-nonobject.js b/src/class-fields/computed-name-toprimitive-returns-nonobject.js index 0fa3ec95af3e6295c0fde9f599499475a08f4915..eae5ce14e637c29c146f4ce4aecdd47b351886e6 100644 --- a/src/class-fields/computed-name-toprimitive-returns-nonobject.js +++ b/src/class-fields/computed-name-toprimitive-returns-nonobject.js @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-toprimitive-symbol.case b/src/class-fields/computed-name-toprimitive-symbol.case index daee6c76f568a8d27bc7a5f8dbb0f78bc57b5a42..708cbd62b10632fa256c19203d55ada63760f5df 100644 --- a/src/class-fields/computed-name-toprimitive-symbol.case +++ b/src/class-fields/computed-name-toprimitive-symbol.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-toprimitive.case b/src/class-fields/computed-name-toprimitive.case index a8c859b9c5d4fba8af4ecc11af26b1f89d3d3578..025e158f0d9c283e33e928e23b29122b7800213e 100644 --- a/src/class-fields/computed-name-toprimitive.case +++ b/src/class-fields/computed-name-toprimitive.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-tostring-err.case b/src/class-fields/computed-name-tostring-err.case index b6d81c06b2293b97c827bb48fdddd00f26cf67a6..fd3c6949d2b00b39b6f8b8ee1cd033fd727392cd 100644 --- a/src/class-fields/computed-name-tostring-err.case +++ b/src/class-fields/computed-name-tostring-err.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-name-valueof-err.case b/src/class-fields/computed-name-valueof-err.case index 232e3c1e9eadfdfe5af816d8917319d9d6e032e6..f91cca77bfce521089f6191fe37599d2023df1fa 100644 --- a/src/class-fields/computed-name-valueof-err.case +++ b/src/class-fields/computed-name-valueof-err.case @@ -20,9 +20,6 @@ info: | 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. diff --git a/src/class-fields/computed-names.case b/src/class-fields/computed-names.case index d0ff46c7b0fe4e4a2ab46b8630fb805bbd136f19..318b5b5ada57941020daa9f7abbc7f3313d309ed 100644 --- a/src/class-fields/computed-names.case +++ b/src/class-fields/computed-names.case @@ -22,17 +22,8 @@ features: [computed-property-names] var x = "b"; //- fields -static ["a"] = 39; [x] = 42; [10] = "meep"; ["not initialized"] +[x] = 42; [10] = "meep"; ["not initialized"] //- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); diff --git a/src/class-fields/info.txt b/src/class-fields/info.txt index 236a9a1488cf8581ef97540748ef8e042683db38..4ec25960e3c0cfa32b7753265ae81c3d598db737 100644 --- a/src/class-fields/info.txt +++ b/src/class-fields/info.txt @@ -2,7 +2,6 @@ MethodDefinition static MethodDefinition FieldDefinition ; - static FieldDefinition ; ; FieldDefinition: @@ -13,4 +12,4 @@ PrivateName PrivateName :: - # IdentifierName \ No newline at end of file + # IdentifierName diff --git a/src/class-fields/init-value-incremental.case b/src/class-fields/init-value-incremental.case index b3cd5a8c083104c0c15eae57be5f9221f403af40..2a1ce00886023980097454c0421efe73da1e13d9 100644 --- a/src/class-fields/init-value-incremental.case +++ b/src/class-fields/init-value-incremental.case @@ -28,53 +28,37 @@ includes: [propertyHelper.js] ---*/ //- setup -var x = 0; +var x = 1; //- 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, + value: 3, enumerable: true, configurable: true, writable: true, }); -verifyProperty(c1, "3", { - value: 7, +verifyProperty(c1, "2", { + value: 4, enumerable: true, configurable: true, writable: true, }); verifyProperty(c2, "1", { - value: 8, + value: 5, enumerable: true, configurable: true, writable: true, }); -verifyProperty(c2, "3", { - value: 9, +verifyProperty(c2, "2", { + value: 6, enumerable: true, configurable: true, writable: true, diff --git a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-comp-name.template deleted file mode 100644 index a922c25b80f4ffc13988d62cac14f01c651e0feb..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-decl-fields-comp-name.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-comp-name- -name: computed ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template deleted file mode 100644 index b4eb238479f1b9fe754a44e7d7ba8aac4b3fcc3e..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-decl-fields-static-comp-name.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-static-comp-name- -name: static computed ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -class C { - static [x] = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template deleted file mode 100644 index 335d76793f7638fcf8f0d5423d3c4a85b5fcadea..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-decl-fields-static-literal-name.template +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-static-literal- -name: static literal ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - static x = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template deleted file mode 100644 index 0138ad74921c8dcdda336971ed671f58dba551fb..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-decl-fields-static-private-name.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-static-private- -name: static PrivateName -features: [class, class-fields-private] ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - static #x = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template deleted file mode 100644 index 5fd801e187837fb2f78cbe5053f539b72a004879..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-decl-fields-static-string-literal-name.template +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-static-string-literal-name- -name: static string literal ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - static 'x' = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template deleted file mode 100644 index cb44207f4e6eae41b0cee358d3449c9bf9083b50..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-expr-fields-static-comp-name.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-static-comp-name- -name: static computed ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -var x = "string"; -var C = class { - static [x] = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template deleted file mode 100644 index 0a840e01efd5ed351b4948655ff22f92175608b4..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-expr-fields-static-literal-name.template +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-static-literal- -name: static literal ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static x = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template deleted file mode 100644 index ea342167f1ea1376b7d4629a29f25bb470cbc415..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-expr-fields-static-private-name.template +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-static-private- -name: static PrivateName -features: [class, class-fields-private] ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static #x = /*{ initializer }*/; -} diff --git a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template b/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template deleted file mode 100644 index deed9b15e3687414715a07044fead97fdf1a72bb..0000000000000000000000000000000000000000 --- a/src/class-fields/initializer-error/cls-expr-fields-static-string-literal-name.template +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-static-string-literal-name- -name: static string literal ClassElementName ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static 'x' = /*{ initializer }*/; -} diff --git a/src/class-fields/propname-error-static/cls-decl-static-literal-name.template b/src/class-fields/propname-error-static/cls-decl-static-literal-name.template deleted file mode 100644 index 30f68ad825ed5805b2a5ba7f099898469c0b43af..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-decl-static-literal-name.template +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-literal-name- -name: early error -- PropName of IdentifierName is forbidden value -negative: - type: SyntaxError - phase: early -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - static /*{ propname }*/; -} diff --git a/src/class-fields/propname-error-static/cls-decl-static-string-name.template b/src/class-fields/propname-error-static/cls-decl-static-string-name.template deleted file mode 100644 index f08d3cb3492c5706b5bf350d74f5d27c233139c6..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-decl-static-string-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-string-name- -name: early error -- PropName of StringLiteral is forbidden value -negative: - type: SyntaxError - phase: early -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. ----*/ - -throw "Test262: This statement should not be evaluated."; - -class C { - static '/*{ propname }*/'; -} diff --git a/src/class-fields/propname-error-static/cls-decl-static-variable-name.template b/src/class-fields/propname-error-static/cls-decl-static-variable-name.template deleted file mode 100644 index 1f9be8d27c41a77b3df4f15c1a703f5e4497f2c7..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-decl-static-variable-name.template +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/statements/class/fields-computed-variable-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var /*{ propname }*/ = "foo"; -class C { - static [/*{ propname }*/]; -} - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/src/class-fields/propname-error-static/cls-expr-static-literal-name.template b/src/class-fields/propname-error-static/cls-expr-static-literal-name.template deleted file mode 100644 index d11b9c43f3b18eb48993baa191ca32ee6b766758..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-expr-static-literal-name.template +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-literal-name- -name: early error -- PropName of IdentifierName is forbidden -negative: - type: SyntaxError - phase: early -info: | - Static Semantics: PropName - LiteralPropertyName : IdentifierName - Return StringValue of IdentifierName. ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static /*{ propname }*/; -}; diff --git a/src/class-fields/propname-error-static/cls-expr-static-string-name.template b/src/class-fields/propname-error-static/cls-expr-static-string-name.template deleted file mode 100644 index 6c1a225ed8b5681a5dd036f5dd620b6f4a33d9a0..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-expr-static-string-name.template +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-string-name- -name: early error -- PropName of StringLiteral is forbidden -negative: - type: SyntaxError - phase: early -info: | - Static Semantics: PropName - ... - LiteralPropertyName : StringLiteral - Return the String value whose code units are the SV of the StringLiteral. ----*/ - -throw "Test262: This statement should not be evaluated."; - -var C = class { - static '/*{ propname }*/'; -}; diff --git a/src/class-fields/propname-error-static/cls-expr-static-variable-name.template b/src/class-fields/propname-error-static/cls-expr-static-variable-name.template deleted file mode 100644 index 8821ead504601dec4b17542675625db3075bd6fb..0000000000000000000000000000000000000000 --- a/src/class-fields/propname-error-static/cls-expr-static-variable-name.template +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-class-definitions-static-semantics-early-errors -path: language/expressions/class/fields-computed-variable-name- -name: no early error -- PropName of ComputedPropertyName not forbidden value -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. ----*/ - -var /*{ propname }*/ = 'foo'; -var C = class { - static [/*{ propname }*/]; -}; - -assert.sameValue(C.hasOwnProperty("foo"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("foo"), false); diff --git a/src/class-fields/static-computed-name-toprimitive-symbol.case b/src/class-fields/static-computed-name-toprimitive-symbol.case deleted file mode 100644 index 49fc61c4915042f48c41d6acc6e4ca34b2613e53..0000000000000000000000000000000000000000 --- a/src/class-fields/static-computed-name-toprimitive-symbol.case +++ /dev/null @@ -1,102 +0,0 @@ -// 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 deleted file mode 100644 index 133eff72bd5f0a8fecb320df1c50fee62335137e..0000000000000000000000000000000000000000 --- a/src/class-fields/static-computed-name-toprimitive.case +++ /dev/null @@ -1,99 +0,0 @@ -// 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 deleted file mode 100644 index 74fb407b5547a0b50996b554c9bed9c340923817..0000000000000000000000000000000000000000 --- a/src/class-fields/static-computed-names.case +++ /dev/null @@ -1,39 +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. - -/*--- -desc: Static Computed property names -info: | - ClassElement: - ... - FieldDefinition ; - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName -template: productions -includes: [propertyHelper.js] -features: [computed-property-names] ----*/ - -//- fields -static ["a"] = 42; ["a"] = 39 -//- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); - -verifyProperty(C, "a", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -verifyProperty(c, "a", { - value: 39, - enumerable: true, - writable: true, - configurable: true -}); diff --git a/src/class-fields/static-computed-symbol-names.case b/src/class-fields/static-computed-symbol-names.case deleted file mode 100644 index 79ec1284cb59ab156d171a36077a251ba12912bb..0000000000000000000000000000000000000000 --- a/src/class-fields/static-computed-symbol-names.case +++ /dev/null @@ -1,54 +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. - -/*--- -desc: Static computed property symbol names -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName -template: productions -includes: [propertyHelper.js] -features: [Symbol, computed-property-names] ----*/ - -//- setup -var x = Symbol(); -var y = Symbol(); - -//- fields -static [x]; static [y] = 42 -//- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, x), false); -assert.sameValue(Object.hasOwnProperty.call(c, x), false); - -verifyProperty(C, x, { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, y), false); -assert.sameValue(Object.hasOwnProperty.call(c, y), false); - -verifyProperty(C, y, { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "x"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "x"), false); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "y"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "y"), false); diff --git a/src/class-fields/static-literal-names.case b/src/class-fields/static-literal-names.case deleted file mode 100644 index 9fd2327a4bb44eedfa69fa219a0d034c1a9c9ae8..0000000000000000000000000000000000000000 --- a/src/class-fields/static-literal-names.case +++ /dev/null @@ -1,56 +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. - -/*--- -desc: Static literal property names -info: | - ClassElement: - ... - FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PropertyName -template: productions -includes: [propertyHelper.js] ----*/ - -//- setup -const fn = function() {} - -//- fields -static a; b = 42; -static c = fn -//- assertions -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "a"), false); - -verifyProperty(C, "a", { - value: undefined, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); -assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); - -verifyProperty(c, "b", { - value: 42, - enumerable: true, - writable: true, - configurable: true -}); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); -assert.sameValue(Object.hasOwnProperty.call(c, "c"), false); - -verifyProperty(C, "c", { - value: fn, - enumerable: true, - writable: true, - configurable: true -}); - diff --git a/src/class-fields/static-private-names.case b/src/class-fields/static-private-names.case deleted file mode 100644 index 89f62976cd4493f79ae3e1a6c1635d079999c3b3..0000000000000000000000000000000000000000 --- a/src/class-fields/static-private-names.case +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: literal private names -info: | - ClassElement: - ... - static FieldDefinition ; - - FieldDefinition: - ClassElementName Initializer_opt - - ClassElementName: - PrivateName - - PrivateName: - #IdentifierName -template: productions -features: [class-fields-private] ----*/ - -//- fields -static #x; static #y -//- privateinspectionfunctions - static x() { - this.#x = 42; - return this.#x; - } - static y() { - this.#y = 43; - return this.#y; - } -//- assertions - -// Test the private fields do not appear as properties before set to value -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#x"), false, "test 1"); -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 2"); -assert.sameValue(Object.hasOwnProperty.call(c, "#x"), false, "test 3"); - -assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#y"), false, "test 4"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 5"); -assert.sameValue(Object.hasOwnProperty.call(c, "#y"), false, "test 6"); - -// Test if private fields can be sucessfully accessed and set to value -assert.sameValue(C.x(), 42, "test 7"); -assert.sameValue(C.y(), 43, "test 8"); - -// Test the private fields do not appear as properties before after set to value -assert.sameValue(Object.hasOwnProperty.call(C, "#x"), false, "test 9"); -assert.sameValue(Object.hasOwnProperty.call(C, "#y"), false, "test 10"); diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case deleted file mode 100644 index 3f3c845fc4f65650a50172ad62ee76d82cadfb1b..0000000000000000000000000000000000000000 --- a/src/class-fields/static-propname-constructor.case +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: static class field forbid PropName 'constructor' -info: | - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -features: [class, class-fields-public] -template: propname-error-static ----*/ - -//- propname -constructor diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case deleted file mode 100644 index 0a514572eda28cc01a7cc069bb0b2186f4c88bab..0000000000000000000000000000000000000000 --- a/src/class-fields/static-propname-prototype.case +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -desc: static class fields forbid PropName 'prototype' -info: | - - // This test file tests the following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". -features: [class, class-fields-public] -template: propname-error-static ----*/ - -//- propname -prototype diff --git a/src/class-fields/static-redeclaration-symbol.case b/src/class-fields/static-redeclaration-symbol.case deleted file mode 100644 index cc811207d75f5ca69db595ddc7a624ab944372cb..0000000000000000000000000000000000000000 --- a/src/class-fields/static-redeclaration-symbol.case +++ /dev/null @@ -1,47 +0,0 @@ -// 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 deleted file mode 100644 index 46bfc9ddd32ebdab10e0059b13464180abba7d16..0000000000000000000000000000000000000000 --- a/src/class-fields/static-redeclaration.case +++ /dev/null @@ -1,47 +0,0 @@ -// 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/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js deleted file mode 100644 index 9cbd70502b5cbded4c8bfa478e2803a0942cfb3b..0000000000000000000000000000000000000000 --- a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - static class fields forbid PropName 'constructor' (no early error for - ComputedPropertyName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - // This test file also tests the ComputedPropertyName won't trigger the - // following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or - "constructor". ----*/ - -var C = class { - static ["constructor"]; -}; - -assert.sameValue(C.hasOwnProperty("constructor"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("constructor"), false); diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js deleted file mode 100644 index 97edf0e44ec3228d85ab72105f85a75205537ec9..0000000000000000000000000000000000000000 --- a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - Cannot redefine a non-configurable, non-writable "prototype" property -esid: runtime-semantics-class-definition-evaluation -features: [class, class-fields-public] -info: | - // This test file also tests the ComputedPropertyName won't trigger the - // following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or - "constructor". - - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 21. Perform MakeConstructor(F, false, proto). - ... - 25. Else, let elements be NonConstructorMethodDefinitions of ClassBody. - 26. Let fieldRecords be a new empty List. - 26. For each ClassElement me 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. - ... - 33. Let result be InitializeStaticFields(F). - ... - - // ClassElementEvaluation should evaluate the ComputedPropertyName - - 12.2.6.7 Runtime Semantics: Evaluation - - ComputedPropertyName:[AssignmentExpression] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - - // And the Static Fields should be defined to the class - - 2.8 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). ----*/ - -assert.throws(TypeError, function() { - var C = class { - static ["prototype"]; - }; -}); diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js deleted file mode 100644 index 760e89bef1e70730fd7b074506dc18cb12bf1029..0000000000000000000000000000000000000000 --- a/test/language/statements/class/fields-computed-name-static-propname-constructor.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - static class fields forbid PropName 'constructor' (no early error for - ComputedPropertyName) -esid: sec-class-definitions-static-semantics-early-errors -features: [class, class-fields-public] -info: | - Static Semantics: PropName - ... - ComputedPropertyName : [ AssignmentExpression ] - Return empty. - - // This test file also tests the ComputedPropertyName won't trigger the - // following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or - "constructor". ----*/ - -class C { - static ["constructor"]; -} - -assert.sameValue(C.hasOwnProperty("constructor"), true); - -var c = new C(); -assert.sameValue(c.hasOwnProperty("constructor"), false); diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js deleted file mode 100644 index df50d86154b9ccbd32f87e9303c7382d6f86c0d6..0000000000000000000000000000000000000000 --- a/test/language/statements/class/fields-computed-name-static-propname-prototype.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: > - Cannot redefine a non-configurable, non-writable "prototype" property -esid: runtime-semantics-class-definition-evaluation -features: [class, class-fields-public] -info: | - // This test file also tests the ComputedPropertyName won't trigger the - // following early error: - Static Semantics: Early Errors - - ClassElement : staticFieldDefinition; - It is a Syntax Error if PropName of FieldDefinition is "prototype" or - "constructor". - - 2.13.2 Runtime Semantics: ClassDefinitionEvaluation - - ... - 21. Perform MakeConstructor(F, false, proto). - ... - 25. Else, let elements be NonConstructorMethodDefinitions of ClassBody. - 26. Let fieldRecords be a new empty List. - 26. For each ClassElement me 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. - ... - 33. Let result be InitializeStaticFields(F). - ... - - // ClassElementEvaluation should evaluate the ComputedPropertyName - - 12.2.6.7 Runtime Semantics: Evaluation - - ComputedPropertyName:[AssignmentExpression] - - 1. Let exprValue be the result of evaluating AssignmentExpression. - 2. Let propName be ? GetValue(exprValue). - 3. Return ? ToPropertyKey(propName). - - // And the Static Fields should be defined to the class - - 2.8 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). ----*/ - -assert.throws(TypeError, function() { - class C { - static ["prototype"]; - }; -}); diff --git a/test/language/statements/class/static-classelementname-abrupt-completion.js b/test/language/statements/class/static-classelementname-abrupt-completion.js deleted file mode 100644 index 77e10ed27b0364e571f2bd6d670413c8b602e82f..0000000000000000000000000000000000000000 --- a/test/language/statements/class/static-classelementname-abrupt-completion.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: Class definition should error if evaluation of static ClassElementName errors -esid: runtime-semantics-class-definition-evaluation -info: | - Runtime Semantics: ClassDefinitionEvaluation - ... - 27. For each ClassElement e in order from elements - a. If IsStatic of e is false, then - i. Let fields be the result of performing ClassElementEvaluation for e with arguments proto and false. - b. Else, - i. Let fields be the result of performing ClassElementEvaluation for e with arguments F and false. - c. If fields is an abrupt completion, then - i. Set the running execution context's LexicalEnvironment to lex. - ii. Set the running execution context's PrivateNameEnvironment to outerPrivateEnvironment. - iii. Return Completion(status). - - Runtime Semantics: ClassElementEvaluation - ... - ClassElement : static FieldDefinition ; - 1. Return ClassFieldDefinitionEvaluation of FieldDefinition with parameter true and object. - - Runtime Semantics: ClassFieldDefinitionEvaluation - With parameters isStatic and homeObject. - FieldDefinition : ClassElementNameInitializer - 1. Let fieldName be the result of evaluating ClassElementName. - 2. ReturnIfAbrupt(fieldName). - -features: [class, class-fields-public] ----*/ - -function f() { - throw new Test262Error(); -} - -assert.throws(Test262Error, function() { - class C { - static [f()] - } -}); diff --git a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js b/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js deleted file mode 100644 index 93ae753081366aea84767e6630248f1e3a3b9f2c..0000000000000000000000000000000000000000 --- a/test/language/statements/class/static-fielddefinition-initializer-abrupt-completion.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2017 Valerie Young. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: Class construction should error if evaluation of static field initializer errors -esid: runtime-semantics-class-definition-evaluation -info: | - Runtime Semantics: ClassDefinitionEvaluation - ... - 33. Let result be InitializeStaticFields(F). - 34. If result is an abrupt completion, then - a. Set the running execution context's LexicalEnvironment to lex. - b. Return Completion(result). - - InitializeStaticFields(F) - 1. Assert: Type(F) is Object. - 2. Assert: F is an ECMAScript function object. - 3. Let fieldRecords be the value of F's [[Fields]] internal slot. - 4. For each item fieldRecord in order from fieldRecords, - a. If fieldRecord.[[static]] is true, then - i. Perform ? DefineField(F, fieldRecord). - - DefineField(receiver, fieldRecord) - 1. Assert: Type(receiver) is Object. - 2. Assert: fieldRecord is a Record as created by ClassFieldDefinitionEvaluation. - 3. Let fieldName be fieldRecord.[[Name]]. - 4. Let initializer be fieldRecord.[[Initializer]]. - 5. If initializer is not empty, then - a. Let initValue be ? Call(initializer, receiver). - -features: [class, class-fields-public] ----*/ - -function f() { - throw new Test262Error(); -} - -assert.throws(Test262Error, function() { - class C { - static x = f(); - } -})