mirror of https://github.com/tc39/test262.git
Class Fields: add private name propname errors
This commit is contained in:
parent
734544272b
commit
1466650ca3
|
@ -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,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"];
|
||||||
|
}
|
Loading…
Reference in New Issue