Skip to content

Commit

Permalink
private fields/methods whitespace syntax error (tc39#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhoosreddy committed Sep 5, 2018
1 parent ef77548 commit 6cc6bf9
Show file tree
Hide file tree
Showing 16 changed files with 233 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/class-fields/class-private-field-whitespace-syntax-error.case
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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() {}
13 changes: 13 additions & 0 deletions src/class-methods/syntax/class-decl.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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 }*/
}
13 changes: 13 additions & 0 deletions src/class-methods/syntax/class-expr.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// 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-invalid-
features: [class]
---*/

var C = class {
/*{ methods }*/
};

0 comments on commit 6cc6bf9

Please sign in to comment.