classfields: add tests for duplicate privatenames

This commit is contained in:
Valerie R Young 2017-10-20 21:16:42 -04:00
parent a456b0a390
commit c39eeb9276
2 changed files with 48 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}