diff --git a/test/language/expressions/class/fields-duplicate-privatenames.js b/test/language/expressions/class/fields-duplicate-privatenames.js new file mode 100644 index 0000000000000000000000000000000000000000..8d1d03da1488632b28781847aa0c13795e0eda87 --- /dev/null +++ b/test/language/expressions/class/fields-duplicate-privatenames.js @@ -0,0 +1,24 @@ +// Copyright 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Syntax error if the same private field defined twice +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries. +---*/ + + +throw "Test262: This statement should not be evaluated."; + +var C = class { + #x; + #x; +} diff --git a/test/language/statements/class/fields-duplicate-privatenames.js b/test/language/statements/class/fields-duplicate-privatenames.js new file mode 100644 index 0000000000000000000000000000000000000000..ee77d36ae23dfa7c7049e6ff59cb078fb7f82a30 --- /dev/null +++ b/test/language/statements/class/fields-duplicate-privatenames.js @@ -0,0 +1,24 @@ +// Copyright 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Syntax error if the same private field defined twice +esid: sec-class-definitions-static-semantics-early-errors +features: [class-fields] +negative: + phase: early + type: SyntaxError +info: | + Static Semantics: Early Errors + + ClassBody : ClassElementList + It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries. +---*/ + + +throw "Test262: This statement should not be evaluated."; + +class C { + #x; + #x; +}