mirror of https://github.com/tc39/test262.git
Update tests to verify lexical grammar of private names
No whitespace allowed between the sigil and the identifier name
This commit is contained in:
parent
19df5b04b2
commit
b183a6f568
|
@ -1,10 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax/invalid
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
//- fields
|
||||
# x = 1
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName ()
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
get # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Accessor set Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
set # m(_) {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Async Generator Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [async-iteration, class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
async * # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Async Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [async-functions, class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
async # m() {}
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (CallExpression)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
MemberExpression :
|
||||
MemberExpression . PrivateName
|
||||
|
||||
CallExpression :
|
||||
CallExpression . PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#x;
|
||||
|
||||
f() {
|
||||
return this;
|
||||
}
|
||||
|
||||
m() {
|
||||
this.f().# x;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Field with Initializer)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
# x = 1;
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Field)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
# x;
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Generator Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [generators, class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
* # m() {}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (MemberExpression)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
MemberExpression :
|
||||
MemberExpression . PrivateName
|
||||
|
||||
CallExpression :
|
||||
CallExpression . PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
#x;
|
||||
m() {
|
||||
this.# x;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
# m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Accessor get Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static get # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Accessor set Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static set # m(_) {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Async Generator Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [async-iteration, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static async * # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Async Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static async # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Field with Initializer)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static # x = 1;
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Field)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-fields-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static # x;
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Generator Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [generators, class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static * # m() {}
|
|
@ -0,0 +1,20 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: No space allowed between sigil and IdentifierName (Static Method)
|
||||
info: |
|
||||
Updated Productions
|
||||
|
||||
ClassElementName :
|
||||
PropertyName
|
||||
PrivateName
|
||||
|
||||
PrivateName ::
|
||||
# IdentifierName
|
||||
template: syntax/invalid
|
||||
features: [class-static-methods-private]
|
||||
---*/
|
||||
|
||||
//- elements
|
||||
static # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static async * # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
async * # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static async # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
async # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static * # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
* # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static set # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
get # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
# m() {}
|
|
@ -1,17 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
m() {
|
||||
this.# x = 1;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
static set # m() {}
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Syntax error if whitespace after '#' sigil
|
||||
template: syntax
|
||||
features: [class-methods-private]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//- methods
|
||||
set # m() {}
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-ClassElement
|
||||
name: class declaration
|
||||
path: language/statements/class/syntax-
|
||||
features: [class]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
/*{ methods }*/
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright (C) 2018 Bloomberg LP. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-ClassElement
|
||||
name: class expression
|
||||
path: language/expressions/class/syntax-
|
||||
features: [class]
|
||||
---*/
|
||||
|
||||
var C = class {
|
||||
/*{ methods }*/
|
||||
};
|
Loading…
Reference in New Issue