diff options
author | Leo Balter <leonardo.balter@gmail.com> | 2017-11-10 15:06:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-10 15:06:00 -0500 |
commit | 076ecc38c62f83816d44663f1f96cb5017d72ba8 (patch) | |
tree | 94e4696948255563131f1f4e750447a204a937b7 /src | |
parent | c4e3d12597fae7e56fa475122aefb7bee3a16f84 (diff) | |
download | qtdeclarative-testsuites-076ecc38c62f83816d44663f1f96cb5017d72ba8.tar.gz |
Fix bugs reported in #1338 (#1339)
* Accessing `ta[0]` throws a TypeError.
* Fix array indices starting at 0 and property references
* Fix classfields templates for properly checking static propnames.
* Generate tests
* `assert.equal` is not defined
* Add missing includes
* Generate tests
* typo s/Avalue/42/
* fix whitespace
* Add missing var for strict mode
* Expand generated class fields tests for forbidden computed property name values
Ref https://github.com/tc39/test262/pull/1339#issuecomment-342830243
* derived classes have access to private names in base classes, if private names are in scope
Diffstat (limited to 'src')
46 files changed, 182 insertions, 20 deletions
diff --git a/src/class-fields/default/cls-decl-after-same-line-async-gen.template b/src/class-fields/default/cls-decl-after-same-line-async-gen.template index 2b7019564..81d3548cf 100644 --- a/src/class-fields/default/cls-decl-after-same-line-async-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-async-gen.template @@ -7,6 +7,7 @@ name: field definitions after an async generator in the same line features: [class-fields, async-iteration] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-async-method.template b/src/class-fields/default/cls-decl-after-same-line-async-method.template index 4834b53fc..62b48966f 100644 --- a/src/class-fields/default/cls-decl-after-same-line-async-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-async-method.template @@ -7,6 +7,7 @@ name: field definitions after an async method in the same line features: [class-fields, async-functions] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-gen.template b/src/class-fields/default/cls-decl-after-same-line-gen.template index 635294c5d..7ca401a7c 100644 --- a/src/class-fields/default/cls-decl-after-same-line-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-gen.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-after-same-line-gen- name: field definitions after a generator in the same line features: [generators, class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-method.template b/src/class-fields/default/cls-decl-after-same-line-method.template index 3ad70efd6..ab59c5bb9 100644 --- a/src/class-fields/default/cls-decl-after-same-line-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-method.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-after-same-line-method- name: field definitions after a method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template b/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template index 60176379a..68d9687cd 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template @@ -7,6 +7,7 @@ name: field definitions after a static async generator in the same line features: [class-fields, async-iteration] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-method.template b/src/class-fields/default/cls-decl-after-same-line-static-async-method.template index 360df4a7f..5b5bb56a1 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-async-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-async-method.template @@ -7,6 +7,7 @@ name: field definitions after a static async method in the same line features: [class-fields, async-functions] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-static-gen.template b/src/class-fields/default/cls-decl-after-same-line-static-gen.template index 2a9fdff3a..1c9137c27 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-gen.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-after-same-line-static-gen- name: field definitions after a static generator in the same line features: [generators, class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-after-same-line-static-method.template b/src/class-fields/default/cls-decl-after-same-line-static-method.template index 568b3c564..2d1351265 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-method.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-after-same-line-static-method- name: field definitions after a static method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-multiple-definitions.template b/src/class-fields/default/cls-decl-multiple-definitions.template index 5671a0b6c..583c8f377 100644 --- a/src/class-fields/default/cls-decl-multiple-definitions.template +++ b/src/class-fields/default/cls-decl-multiple-definitions.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-multiple-definitions- name: multiple fields definitions features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-multiple-stacked-definitions.template b/src/class-fields/default/cls-decl-multiple-stacked-definitions.template index 36515109e..7c95c62ff 100644 --- a/src/class-fields/default/cls-decl-multiple-stacked-definitions.template +++ b/src/class-fields/default/cls-decl-multiple-stacked-definitions.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-multiple-stacked-definitions- name: multiple stacked fields definitions through ASI features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-new-no-sc-line-method.template b/src/class-fields/default/cls-decl-new-no-sc-line-method.template index 56037a513..630d9c51e 100644 --- a/src/class-fields/default/cls-decl-new-no-sc-line-method.template +++ b/src/class-fields/default/cls-decl-new-no-sc-line-method.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-new-no-sc-line-method- name: field definitions followed by a method in a new line without a semicolon features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-new-sc-line-generator.template b/src/class-fields/default/cls-decl-new-sc-line-generator.template index 40098a781..b347c09b9 100644 --- a/src/class-fields/default/cls-decl-new-sc-line-generator.template +++ b/src/class-fields/default/cls-decl-new-sc-line-generator.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-new-sc-line-gen- name: field definitions followed by a method in a new line with a semicolon features: [class-fields, generators] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-new-sc-line-method.template b/src/class-fields/default/cls-decl-new-sc-line-method.template index 6f5635646..4f714e29f 100644 --- a/src/class-fields/default/cls-decl-new-sc-line-method.template +++ b/src/class-fields/default/cls-decl-new-sc-line-method.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-new-sc-line-method- name: field definitions followed by a method in a new line with a semicolon features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-same-line-generator.template b/src/class-fields/default/cls-decl-same-line-generator.template index 182d9df50..420268b69 100644 --- a/src/class-fields/default/cls-decl-same-line-generator.template +++ b/src/class-fields/default/cls-decl-same-line-generator.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-same-line-gen- name: field definitions followed by a generator method in the same line features: [class-fields, generators] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-decl-same-line-method.template b/src/class-fields/default/cls-decl-same-line-method.template index c94c864bd..3b1be5f58 100644 --- a/src/class-fields/default/cls-decl-same-line-method.template +++ b/src/class-fields/default/cls-decl-same-line-method.template @@ -6,6 +6,7 @@ path: language/statements/class/fields-same-line-method- name: field definitions followed by a method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ class C { diff --git a/src/class-fields/default/cls-expr-after-same-line-async-gen.template b/src/class-fields/default/cls-expr-after-same-line-async-gen.template index 3a1a6f463..a86b3256a 100644 --- a/src/class-fields/default/cls-expr-after-same-line-async-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-async-gen.template @@ -7,6 +7,7 @@ name: field definitions after an async generator in the same line features: [class-fields, async-iteration] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-async-method.template b/src/class-fields/default/cls-expr-after-same-line-async-method.template index 87c137ce2..f1a0f2695 100644 --- a/src/class-fields/default/cls-expr-after-same-line-async-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-async-method.template @@ -7,6 +7,7 @@ name: field definitions after an async method in the same line features: [class-fields, async-functions] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-gen.template b/src/class-fields/default/cls-expr-after-same-line-gen.template index 58aa427d3..1434038df 100644 --- a/src/class-fields/default/cls-expr-after-same-line-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-gen.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-after-same-line-gen- name: field definitions after a generator in the same line features: [generators, class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-method.template b/src/class-fields/default/cls-expr-after-same-line-method.template index d9e6703d6..9f25e8b48 100644 --- a/src/class-fields/default/cls-expr-after-same-line-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-method.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-after-same-line-method- name: field definitions after a method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template b/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template index f19896d7a..bda88adcc 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template @@ -7,6 +7,7 @@ name: field definitions after a static async generator in the same line features: [class-fields, async-iteration] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-method.template b/src/class-fields/default/cls-expr-after-same-line-static-async-method.template index 0b0ae19ec..f9e61dc7f 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-async-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-async-method.template @@ -7,6 +7,7 @@ name: field definitions after a static async method in the same line features: [class-fields, async-functions] flags: [async] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-static-gen.template b/src/class-fields/default/cls-expr-after-same-line-static-gen.template index 1eff6019a..278275a30 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-gen.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-after-same-line-static-gen- name: field definitions after a static generator in the same line features: [generators, class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-after-same-line-static-method.template b/src/class-fields/default/cls-expr-after-same-line-static-method.template index 162137947..2b6f3e4dd 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-method.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-after-same-line-static-method- name: field definitions after a static method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-multiple-definitions.template b/src/class-fields/default/cls-expr-multiple-definitions.template index 8a786bf9e..00c2175eb 100644 --- a/src/class-fields/default/cls-expr-multiple-definitions.template +++ b/src/class-fields/default/cls-expr-multiple-definitions.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-multiple-definitions- name: multiple fields definitions features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-multiple-stacked-definitions.template b/src/class-fields/default/cls-expr-multiple-stacked-definitions.template index a1c53aee1..dd920d97e 100644 --- a/src/class-fields/default/cls-expr-multiple-stacked-definitions.template +++ b/src/class-fields/default/cls-expr-multiple-stacked-definitions.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-multiple-stacked-definitions- name: multiple stacked fields definitions through ASI features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-new-no-sc-line-method.template b/src/class-fields/default/cls-expr-new-no-sc-line-method.template index 50e6762ad..320f62682 100644 --- a/src/class-fields/default/cls-expr-new-no-sc-line-method.template +++ b/src/class-fields/default/cls-expr-new-no-sc-line-method.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-new-no-sc-line-method- name: field definitions followed by a method in a new line without a semicolon features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-new-sc-line-generator.template b/src/class-fields/default/cls-expr-new-sc-line-generator.template index 143317368..e956c11b6 100644 --- a/src/class-fields/default/cls-expr-new-sc-line-generator.template +++ b/src/class-fields/default/cls-expr-new-sc-line-generator.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-new-sc-line-gen- name: field definitions followed by a method in a new line with a semicolon features: [class-fields, generators] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-new-sc-line-method.template b/src/class-fields/default/cls-expr-new-sc-line-method.template index 3e7291ad6..8be8ce2ed 100644 --- a/src/class-fields/default/cls-expr-new-sc-line-method.template +++ b/src/class-fields/default/cls-expr-new-sc-line-method.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-new-sc-line-method- name: field definitions followed by a method in a new line with a semicolon features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-same-line-generator.template b/src/class-fields/default/cls-expr-same-line-generator.template index c6ee64851..286d60af3 100644 --- a/src/class-fields/default/cls-expr-same-line-generator.template +++ b/src/class-fields/default/cls-expr-same-line-generator.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-same-line-gen- name: field definitions followed by a generator method in the same line features: [class-fields, generators] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { diff --git a/src/class-fields/default/cls-expr-same-line-method.template b/src/class-fields/default/cls-expr-same-line-method.template index 4c9602caf..d565e5c5e 100644 --- a/src/class-fields/default/cls-expr-same-line-method.template +++ b/src/class-fields/default/cls-expr-same-line-method.template @@ -6,6 +6,7 @@ path: language/expressions/class/fields-same-line-method- name: field definitions followed by a method in the same line features: [class-fields] esid: prod-FieldDefinition +includes: [propertyHelper.js] ---*/ var C = class { 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 new file mode 100644 index 000000000..30f68ad82 --- /dev/null +++ b/src/class-fields/propname-error-static/cls-decl-static-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-static/cls-decl-static-string-name.template b/src/class-fields/propname-error-static/cls-decl-static-string-name.template new file mode 100644 index 000000000..f08d3cb34 --- /dev/null +++ b/src/class-fields/propname-error-static/cls-decl-static-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-static/cls-decl-static-variable-name.template b/src/class-fields/propname-error-static/cls-decl-static-variable-name.template new file mode 100644 index 000000000..1f9be8d27 --- /dev/null +++ b/src/class-fields/propname-error-static/cls-decl-static-variable-name.template @@ -0,0 +1,23 @@ +// 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 new file mode 100644 index 000000000..d11b9c43f --- /dev/null +++ b/src/class-fields/propname-error-static/cls-expr-static-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-static/cls-expr-static-string-name.template b/src/class-fields/propname-error-static/cls-expr-static-string-name.template new file mode 100644 index 000000000..6c1a225ed --- /dev/null +++ b/src/class-fields/propname-error-static/cls-expr-static-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-static/cls-expr-static-variable-name.template b/src/class-fields/propname-error-static/cls-expr-static-variable-name.template new file mode 100644 index 000000000..8821ead50 --- /dev/null +++ b/src/class-fields/propname-error-static/cls-expr-static-variable-name.template @@ -0,0 +1,23 @@ +// 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/propname-error/cls-decl-computed-name.template b/src/class-fields/propname-error/cls-decl-computed-name.template index 406a20970..547750ae0 100644 --- a/src/class-fields/propname-error/cls-decl-computed-name.template +++ b/src/class-fields/propname-error/cls-decl-computed-name.template @@ -14,9 +14,10 @@ info: | var x = "/*{ propname }*/"; class C { - /*{ static }*/ [x]; + [x]; } var c = new C(); assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); +assert.sameValue(C.hasOwnProperty("/*{ propname }*/"), false); diff --git a/src/class-fields/propname-error/cls-decl-literal-name.template b/src/class-fields/propname-error/cls-decl-literal-name.template index 3c4ce9e9e..4428fec10 100644 --- a/src/class-fields/propname-error/cls-decl-literal-name.template +++ b/src/class-fields/propname-error/cls-decl-literal-name.template @@ -17,5 +17,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - /*{ static }*/ /*{ propname }*/; + /*{ 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 index 743f20f74..85f116bc1 100644 --- a/src/class-fields/propname-error/cls-decl-string-name.template +++ b/src/class-fields/propname-error/cls-decl-string-name.template @@ -18,5 +18,5 @@ info: | throw "Test262: This statement should not be evaluated."; class C { - /*{ static }*/ '/*{ propname }*/'; + '/*{ 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 index cbda5b831..ade7741a3 100644 --- a/src/class-fields/propname-error/cls-decl-variable-name.template +++ b/src/class-fields/propname-error/cls-decl-variable-name.template @@ -14,9 +14,10 @@ info: | var /*{ propname }*/ = 'foo'; class C { - /*{ static }*/ [/*{ propname }*/]; + [/*{ propname }*/]; } var c = new C(); assert.sameValue(c.hasOwnProperty("foo"), true); +assert.sameValue(C.hasOwnProperty("foo"), false); diff --git a/src/class-fields/propname-error/cls-expr-computed-name.template b/src/class-fields/propname-error/cls-expr-computed-name.template index e509263ee..2abdbb6d5 100644 --- a/src/class-fields/propname-error/cls-expr-computed-name.template +++ b/src/class-fields/propname-error/cls-expr-computed-name.template @@ -14,9 +14,10 @@ info: | var x = "/*{ propname }*/"; var C = class { - /*{ static }*/ [x]; -} + [x]; +}; var c = new C(); - assert.sameValue(c.hasOwnProperty("/*{ propname }*/"), true); + +assert.sameValue(C.hasOwnProperty("/*{ propname }*/"), false); diff --git a/src/class-fields/propname-error/cls-expr-literal-name.template b/src/class-fields/propname-error/cls-expr-literal-name.template index bd87b81d2..1051b99e3 100644 --- a/src/class-fields/propname-error/cls-expr-literal-name.template +++ b/src/class-fields/propname-error/cls-expr-literal-name.template @@ -17,5 +17,5 @@ info: | throw "Test262: This statement should not be evaluated."; var C = class { - /*{ static }*/ /*{ propname }*/; -} + /*{ 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 index 189a1bd80..91da7e5fd 100644 --- a/src/class-fields/propname-error/cls-expr-string-name.template +++ b/src/class-fields/propname-error/cls-expr-string-name.template @@ -18,5 +18,5 @@ info: | throw "Test262: This statement should not be evaluated."; var C = class { - /*{ static }*/ '/*{ propname }*/'; -} + '/*{ 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 index 50b255197..1435862de 100644 --- a/src/class-fields/propname-error/cls-expr-variable-name.template +++ b/src/class-fields/propname-error/cls-expr-variable-name.template @@ -14,9 +14,10 @@ info: | var /*{ propname }*/ = 'foo'; var C = class { - /*{ static }*/ [/*{ propname }*/]; -} + [/*{ propname }*/]; +}; var c = new C(); - assert.sameValue(c.hasOwnProperty("foo"), true); + +assert.sameValue(C.hasOwnProperty("foo"), false); diff --git a/src/class-fields/static-propname-constructor.case b/src/class-fields/static-propname-constructor.case index ff3d00af6..b76be8ebb 100644 --- a/src/class-fields/static-propname-constructor.case +++ b/src/class-fields/static-propname-constructor.case @@ -11,10 +11,8 @@ info: | ClassElement : staticFieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". features: [class-fields] -template: propname-error +template: propname-error-static ---*/ -//- static -static //- propname constructor diff --git a/src/class-fields/static-propname-prototype.case b/src/class-fields/static-propname-prototype.case index 99d85ff64..30911e943 100644 --- a/src/class-fields/static-propname-prototype.case +++ b/src/class-fields/static-propname-prototype.case @@ -11,10 +11,8 @@ info: | ClassElement : staticFieldDefinition; It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor". features: [class-fields] -template: propname-error +template: propname-error-static ---*/ -//- static -static //- propname prototype |