Skip to content
Snippets Groups Projects
Commit b183a6f5 authored by Leo Balter's avatar Leo Balter
Browse files

Update tests to verify lexical grammar of private names

No whitespace allowed between the sigil and the identifier name
parent 19df5b04
No related branches found
No related tags found
No related merge requests found
Showing
with 375 additions and 32 deletions
// 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
/*---
desc: No space allowed between sigil and IdentifierName ()
info: |
Updated Productions
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/invalid
features: [class-methods-private]
negative:
phase: parse
type: SyntaxError
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
get # m() {}
// 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
/*---
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]
negative:
phase: parse
type: SyntaxError
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
async # m() {}
//- elements
set # m(_) {}
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
async * # m() {}
......@@ -2,12 +2,19 @@
// 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]
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]
---*/
class C {
/*{ methods }*/
}
//- elements
async # m() {}
// 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;
}
// 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;
// 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;
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
* # m() {}
// 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
/*---
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]
---*/
//- fields
# x = 1
//- elements
#x;
m() {
this.# x;
}
// 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
/*---
desc: No space allowed between sigil and IdentifierName (Method)
info: |
Updated Productions
ClassElementName :
PropertyName
PrivateName
PrivateName ::
# IdentifierName
template: syntax/invalid
features: [class-methods-private]
negative:
phase: parse
type: SyntaxError
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
# m() {}
......@@ -2,12 +2,19 @@
// 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]
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]
---*/
var C = class {
/*{ methods }*/
};
//- elements
static get # m() {}
// 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(_) {}
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
static async * # m() {}
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
static async # m() {}
// 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;
// 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;
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
static * # m() {}
// 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
/*---
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]
---*/
//- setup
throw "Test262: This statement should not be evaluated.";
//- methods
//- elements
static # m() {}
// 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() {}
// 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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment