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/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; +}