diff --git a/src/class-fields/propname-constructor.case b/src/class-fields/propname-constructor.case new file mode 100644 index 0000000000000000000000000000000000000000..3353606ddb8d09b79ad488e37634c6d637f087cb --- /dev/null +++ b/src/class-fields/propname-constructor.case @@ -0,0 +1,18 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: class fields forbid PropName 'constructor' +info: | + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". +features: [class-fields] +template: propname-error +---*/ + +//- propname +constructor diff --git a/src/class-fields/propname-error/cls-decl-computed-name.template b/src/class-fields/propname-error/cls-decl-computed-name.template new file mode 100644 index 0000000000000000000000000000000000000000..406a209707dab4763058f471022dd314228fb338 --- /dev/null +++ b/src/class-fields/propname-error/cls-decl-computed-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-computed-name- +name: no early error -- PropName of ComputedPropertyName not forbidden value +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. +---*/ + +var x = "/*{ propname }*/"; +class C { + /*{ static }*/ [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); diff --git a/src/class-fields/propname-error/cls-decl-literal-name.template b/src/class-fields/propname-error/cls-decl-literal-name.template new file mode 100644 index 0000000000000000000000000000000000000000..3c4ce9e9e74346d93172c72f884eb92798d1bd54 --- /dev/null +++ b/src/class-fields/propname-error/cls-decl-literal-name.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-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/cls-decl-string-name.template b/src/class-fields/propname-error/cls-decl-string-name.template new file mode 100644 index 0000000000000000000000000000000000000000..743f20f744f42021d3909eaccd16a32cc3ec520b --- /dev/null +++ b/src/class-fields/propname-error/cls-decl-string-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-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/cls-decl-variable-name.template b/src/class-fields/propname-error/cls-decl-variable-name.template new file mode 100644 index 0000000000000000000000000000000000000000..cbda5b8319321bfe233b48adecaf8491420bbf2b --- /dev/null +++ b/src/class-fields/propname-error/cls-decl-variable-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/statements/class/fields-computed-variable-name- +name: no early error -- PropName of ComputedPropertyName not forbidden value +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. +---*/ + +var /*{ propname }*/ = 'foo'; +class C { + /*{ static }*/ [/*{ propname }*/]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/src/class-fields/propname-error/cls-expr-computed-name.template b/src/class-fields/propname-error/cls-expr-computed-name.template new file mode 100644 index 0000000000000000000000000000000000000000..e509263eea36c874ce0c147ec3c26216d6d0bfdc --- /dev/null +++ b/src/class-fields/propname-error/cls-expr-computed-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-computed-name- +name: no early error -- PropName of ComputedPropertyName not forbidden value +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. +---*/ + +var x = "/*{ propname }*/"; +var C = class { + /*{ static }*/ [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); diff --git a/src/class-fields/propname-error/cls-expr-literal-name.template b/src/class-fields/propname-error/cls-expr-literal-name.template new file mode 100644 index 0000000000000000000000000000000000000000..bd87b81d2ae7a812ac3a0937aa82b9134dd12557 --- /dev/null +++ b/src/class-fields/propname-error/cls-expr-literal-name.template @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-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/cls-expr-string-name.template b/src/class-fields/propname-error/cls-expr-string-name.template new file mode 100644 index 0000000000000000000000000000000000000000..189a1bd80f473c60a3a5730fffc17e035cba1d59 --- /dev/null +++ b/src/class-fields/propname-error/cls-expr-string-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-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/cls-expr-variable-name.template b/src/class-fields/propname-error/cls-expr-variable-name.template new file mode 100644 index 0000000000000000000000000000000000000000..50b255197f9f61549b18e6db7c36150cf0c7bcaf --- /dev/null +++ b/src/class-fields/propname-error/cls-expr-variable-name.template @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-class-definitions-static-semantics-early-errors +path: language/expressions/class/fields-computed-variable-name- +name: no early error -- PropName of ComputedPropertyName not forbidden value +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. +---*/ + +var /*{ propname }*/ = 'foo'; +var C = class { + /*{ static }*/ [/*{ propname }*/]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case new file mode 100644 index 0000000000000000000000000000000000000000..ff3d00af6abefb7d68838d00e5ec6130bd877d3d --- /dev/null +++ b/src/class-fields/static-propname-constructor.case @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: static class field forbid PropName 'constructor' +info: | + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". +features: [class-fields] +template: propname-error +---*/ + +//- static +static +//- propname +constructor diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case new file mode 100644 index 0000000000000000000000000000000000000000..99d85ff64a6c5118290ce2d77fb0c3b7c42326b7 --- /dev/null +++ b/src/class-fields/static-propname-prototype.case @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: static class fields forbid PropName 'prototype' +info: | + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". +features: [class-fields] +template: propname-error +---*/ + +//- static +static +//- propname +prototype diff --git a/test/language/expressions/class/fields-computed-name-propname-constructor.js b/test/language/expressions/class/fields-computed-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..f5ff6b9f7f118051f98b176b08825107b34fcfe1 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-expr-computed-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var x = "constructor"; +var C = class { + [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("constructor"), true); diff --git a/test/language/expressions/class/fields-computed-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..e9c0cb9a9e22952183baec96c2c22282b2915881 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-expr-computed-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var x = "constructor"; +var C = class { + static [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("constructor"), true); diff --git a/test/language/expressions/class/fields-computed-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..adfc8c4c31677231c9458e312f70248f0e5b1708 --- /dev/null +++ b/test/language/expressions/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-expr-computed-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var x = "prototype"; +var C = class { + static [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("prototype"), true); diff --git a/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..c7b59287230d9df923b8ccdd19bca630ee52634a --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var constructor = 'foo'; +var C = class { + [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..07ceecee421a6aed3e2b4f402799c6afdb4512c0 --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var constructor = 'foo'; +var C = class { + static [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..baa70023242d89549deeda1e872e078d84eeda69 --- /dev/null +++ b/test/language/expressions/class/fields-computed-variable-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-expr-variable-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var prototype = 'foo'; +var C = class { + static [prototype]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/expressions/class/fields-literal-name-propname-constructor.js b/test/language/expressions/class/fields-literal-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..7e6f815523cde43db957ec2e84818b477262a545 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-propname-constructor.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-expr-literal-name.template +/*--- +description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + constructor; +} diff --git a/test/language/expressions/class/fields-literal-name-static-propname-constructor.js b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..242decedccae08b52efa5605bacf302c766c5b04 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-expr-literal-name.template +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static constructor; +} diff --git a/test/language/expressions/class/fields-literal-name-static-propname-prototype.js b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..8757af59ede452f317bff28299a1a120d29306f1 --- /dev/null +++ b/test/language/expressions/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-expr-literal-name.template +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static prototype; +} diff --git a/test/language/expressions/class/fields-privatename-constructor-err.js b/test/language/expressions/class/fields-privatename-constructor-err.js new file mode 100644 index 0000000000000000000000000000000000000000..da6f65668a4471601c28ac05b5570056713da911 --- /dev/null +++ b/test/language/expressions/class/fields-privatename-constructor-err.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Private class fields early error with StringValue "#constructor" +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +negative: + phase: early + type: SyntaxError +info: | + ClassElementName : PrivateName; + It is a Syntax Error if StringValue of PrivateName is "#constructor". +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #constructor; +} diff --git a/test/language/expressions/class/fields-string-name-propname-constructor.js b/test/language/expressions/class/fields-string-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..06e0261b060d8ea23252d0ae80b83f9cb3da7669 --- /dev/null +++ b/test/language/expressions/class/fields-string-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-expr-string-name.template +/*--- +description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + 'constructor'; +} diff --git a/test/language/expressions/class/fields-string-name-static-propname-constructor.js b/test/language/expressions/class/fields-string-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..bf52ad29c78ea29da9bb28c7ae7d0a8125275784 --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-expr-string-name.template +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'constructor'; +} diff --git a/test/language/expressions/class/fields-string-name-static-propname-prototype.js b/test/language/expressions/class/fields-string-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..69baf5684558bb67d25813eaf0fb5b6f4f63894f --- /dev/null +++ b/test/language/expressions/class/fields-string-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-expr-string-name.template +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + static 'prototype'; +} diff --git a/test/language/statements/class/fields-computed-name-propname-constructor.js b/test/language/statements/class/fields-computed-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..5d3b632fad83d9a9215d8a6a3a2c821fe7c102c5 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-decl-computed-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var x = "constructor"; +class C { + [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("constructor"), true); diff --git a/test/language/statements/class/fields-computed-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..b55077f4ba4be3eae4965f44140229d20cd67884 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-computed-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var x = "constructor"; +class C { + static [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("constructor"), true); diff --git a/test/language/statements/class/fields-computed-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..e8fd0641ed543007f49a36e71bcb5d0938ae0037 --- /dev/null +++ b/test/language/statements/class/fields-computed-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-computed-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var x = "prototype"; +class C { + static [x]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("prototype"), true); diff --git a/test/language/statements/class/fields-computed-variable-name-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..c538d7d2eddef4ce3c6776a4cdbd66f0dff736aa --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: class fields forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +var constructor = 'foo'; +class C { + [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js b/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..906c821aa2d79ab1e19d7ef8c845df0cd41d2ee3 --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: static class field forbid PropName 'constructor' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var constructor = 'foo'; +class C { + static [constructor]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js b/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..5de8dc2f569749b4deb4351dc2a90024456b142c --- /dev/null +++ b/test/language/statements/class/fields-computed-variable-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-variable-name.template +/*--- +description: static class fields forbid PropName 'prototype' (no early error -- PropName of ComputedPropertyName not forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +info: | + Static Semantics: PropName + ... + ComputedPropertyName : [ AssignmentExpression ] + Return empty. + + + // 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". + +---*/ + + +var prototype = 'foo'; +class C { + static [prototype]; +} + +var c = new C(); + +assert.sameValue(c.hasOwnProperty("foo"), true); diff --git a/test/language/statements/class/fields-literal-name-propname-constructor.js b/test/language/statements/class/fields-literal-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..2e8089661f681bf2db7870a2374143adfdde417c --- /dev/null +++ b/test/language/statements/class/fields-literal-name-propname-constructor.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-decl-literal-name.template +/*--- +description: class fields forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + constructor; +} diff --git a/test/language/statements/class/fields-literal-name-static-propname-constructor.js b/test/language/statements/class/fields-literal-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..3b7e8e66f8efb38f1c7a517ca9ad209b1dc1446b --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-constructor.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-literal-name.template +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static constructor; +} diff --git a/test/language/statements/class/fields-literal-name-static-propname-prototype.js b/test/language/statements/class/fields-literal-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..736391bee49a836104f545242a216da1281ca0db --- /dev/null +++ b/test/language/statements/class/fields-literal-name-static-propname-prototype.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-literal-name.template +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of IdentifierName is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + LiteralPropertyName : IdentifierName + Return StringValue of IdentifierName. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static prototype; +} diff --git a/test/language/statements/class/fields-privatename-constructor-err.js b/test/language/statements/class/fields-privatename-constructor-err.js new file mode 100644 index 0000000000000000000000000000000000000000..22946c3b4cfb9bf0fad997a5cc36b5d930c14c8b --- /dev/null +++ b/test/language/statements/class/fields-privatename-constructor-err.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Private class fields early error with StringValue "#constructor" +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +negative: + phase: early + type: SyntaxError +info: | + ClassElementName : PrivateName; + It is a Syntax Error if StringValue of PrivateName is "#constructor". +---*/ + +throw "Test262: This statement should not be evaluated."; + +class C { + #constructor; +} diff --git a/test/language/statements/class/fields-string-name-propname-constructor.js b/test/language/statements/class/fields-string-name-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..0e72cc49560623ffaa39f1b7df64640fdb98602d --- /dev/null +++ b/test/language/statements/class/fields-string-name-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/propname-constructor.case +// - src/class-fields/propname-error/cls-decl-string-name.template +/*--- +description: class fields forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : FieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + 'constructor'; +} diff --git a/test/language/statements/class/fields-string-name-static-propname-constructor.js b/test/language/statements/class/fields-string-name-static-propname-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..ff31d8ec0a4a7ef891a6f432428cc94e498fb397 --- /dev/null +++ b/test/language/statements/class/fields-string-name-static-propname-constructor.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-constructor.case +// - src/class-fields/propname-error/cls-decl-string-name.template +/*--- +description: static class field forbid PropName 'constructor' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'constructor'; +} diff --git a/test/language/statements/class/fields-string-name-static-propname-prototype.js b/test/language/statements/class/fields-string-name-static-propname-prototype.js new file mode 100644 index 0000000000000000000000000000000000000000..24de80aaeb71a5b5c26b27f39ec69cebb47ecf63 --- /dev/null +++ b/test/language/statements/class/fields-string-name-static-propname-prototype.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/static-propname-prototype.case +// - src/class-fields/propname-error/cls-decl-string-name.template +/*--- +description: static class fields forbid PropName 'prototype' (early error -- PropName of StringLiteral is forbidden value) +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +flags: [generated] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: PropName + ... + LiteralPropertyName : StringLiteral + Return the String value whose code units are the SV of the StringLiteral. + + + // This test file tests the following early error: + Static Semantics: Early Errors + + ClassElement : staticFieldDefinition; + It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". + +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + static 'prototype'; +}