Update tests to verify lexical grammar of private names

No whitespace allowed between the sigil and the identifier name
This commit is contained in:
Leo Balter 2018-09-10 16:52:26 -04:00
parent 19df5b04b2
commit b183a6f568
34 changed files with 375 additions and 233 deletions

View File

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

View File

@ -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() {}

View File

@ -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(_) {}

View File

@ -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() {}

View File

@ -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() {}

View File

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

View File

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

View File

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

View File

@ -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() {}

View File

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

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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(_) {}

View File

@ -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() {}

View File

@ -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() {}

View File

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

View File

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

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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() {}

View File

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

View File

@ -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() {}

View File

@ -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() {}

View File

@ -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 }*/
}

View File

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