Skip to content

Commit

Permalink
Class Fields: add private name propname errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron authored and leobalter committed Aug 20, 2018
1 parent 7345442 commit 1466650
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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.
/*---
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, class-fields-private]
negative:
phase: parse
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;
}
Original file line number Diff line number Diff line change
@@ -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.
/*---
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, class-fields-private]
negative:
phase: parse
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"];
}

0 comments on commit 1466650

Please sign in to comment.