mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 05:55:36 +02:00
classfields: add tests for forbidden privatenames
This commit is contained in:
parent
458e33afe3
commit
ea4c8fc95c
@ -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;
|
||||
}
|
@ -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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user