From 19df5b04b26055423e6d73754e7e461fe9bfdd7f Mon Sep 17 00:00:00 2001 From: jbhoosreddy Date: Tue, 4 Sep 2018 22:28:09 -0400 Subject: [PATCH] private fields/methods whitespace syntax error (#1343) --- ...s-private-field-whitespace-syntax-error.case | 10 ++++++++++ ...r-method-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...enerator-method-whitespace-syntax-error.case | 15 +++++++++++++++ ...c-method-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...te-async-method-whitespace-syntax-error.case | 15 +++++++++++++++ ...r-method-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...enerator-method-whitespace-syntax-error.case | 15 +++++++++++++++ ...e-getter-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...-private-getter-whitespace-syntax-error.case | 15 +++++++++++++++ ...e-method-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...-private-method-whitespace-syntax-error.case | 15 +++++++++++++++ ...te-method-whitespace-usage-syntax-error.case | 17 +++++++++++++++++ ...e-setter-static-whitespace-syntax-error.case | 15 +++++++++++++++ ...-private-setter-whitespace-syntax-error.case | 15 +++++++++++++++ src/class-methods/syntax/class-decl.template | 13 +++++++++++++ src/class-methods/syntax/class-expr.template | 13 +++++++++++++ 16 files changed, 233 insertions(+) create mode 100644 src/class-elements/class-private-field-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-async-generator-method-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-async-generator-method-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-async-method-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-async-method-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-generator-method-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-generator-method-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-getter-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-getter-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-method-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-method-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-method-whitespace-usage-syntax-error.case create mode 100644 src/class-methods/class-private-setter-static-whitespace-syntax-error.case create mode 100644 src/class-methods/class-private-setter-whitespace-syntax-error.case create mode 100644 src/class-methods/syntax/class-decl.template create mode 100644 src/class-methods/syntax/class-expr.template diff --git a/src/class-elements/class-private-field-whitespace-syntax-error.case b/src/class-elements/class-private-field-whitespace-syntax-error.case new file mode 100644 index 0000000000..37d3702700 --- /dev/null +++ b/src/class-elements/class-private-field-whitespace-syntax-error.case @@ -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 diff --git a/src/class-methods/class-private-async-generator-method-static-whitespace-syntax-error.case b/src/class-methods/class-private-async-generator-method-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..ea3e7374ed --- /dev/null +++ b/src/class-methods/class-private-async-generator-method-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-async-generator-method-whitespace-syntax-error.case b/src/class-methods/class-private-async-generator-method-whitespace-syntax-error.case new file mode 100644 index 0000000000..8989cb811b --- /dev/null +++ b/src/class-methods/class-private-async-generator-method-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-async-method-static-whitespace-syntax-error.case b/src/class-methods/class-private-async-method-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..12106904ea --- /dev/null +++ b/src/class-methods/class-private-async-method-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-async-method-whitespace-syntax-error.case b/src/class-methods/class-private-async-method-whitespace-syntax-error.case new file mode 100644 index 0000000000..a7a2c25958 --- /dev/null +++ b/src/class-methods/class-private-async-method-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-generator-method-static-whitespace-syntax-error.case b/src/class-methods/class-private-generator-method-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..37069b4fee --- /dev/null +++ b/src/class-methods/class-private-generator-method-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-generator-method-whitespace-syntax-error.case b/src/class-methods/class-private-generator-method-whitespace-syntax-error.case new file mode 100644 index 0000000000..3a97227731 --- /dev/null +++ b/src/class-methods/class-private-generator-method-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-getter-static-whitespace-syntax-error.case b/src/class-methods/class-private-getter-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..65525415b3 --- /dev/null +++ b/src/class-methods/class-private-getter-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-getter-whitespace-syntax-error.case b/src/class-methods/class-private-getter-whitespace-syntax-error.case new file mode 100644 index 0000000000..2c067f1372 --- /dev/null +++ b/src/class-methods/class-private-getter-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-method-static-whitespace-syntax-error.case b/src/class-methods/class-private-method-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..c29a56416b --- /dev/null +++ b/src/class-methods/class-private-method-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-method-whitespace-syntax-error.case b/src/class-methods/class-private-method-whitespace-syntax-error.case new file mode 100644 index 0000000000..cd0feaeb5f --- /dev/null +++ b/src/class-methods/class-private-method-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-method-whitespace-usage-syntax-error.case b/src/class-methods/class-private-method-whitespace-usage-syntax-error.case new file mode 100644 index 0000000000..dd53217e3c --- /dev/null +++ b/src/class-methods/class-private-method-whitespace-usage-syntax-error.case @@ -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; +} diff --git a/src/class-methods/class-private-setter-static-whitespace-syntax-error.case b/src/class-methods/class-private-setter-static-whitespace-syntax-error.case new file mode 100644 index 0000000000..65525415b3 --- /dev/null +++ b/src/class-methods/class-private-setter-static-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/class-private-setter-whitespace-syntax-error.case b/src/class-methods/class-private-setter-whitespace-syntax-error.case new file mode 100644 index 0000000000..c9c7dca58b --- /dev/null +++ b/src/class-methods/class-private-setter-whitespace-syntax-error.case @@ -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() {} diff --git a/src/class-methods/syntax/class-decl.template b/src/class-methods/syntax/class-decl.template new file mode 100644 index 0000000000..e7f3172437 --- /dev/null +++ b/src/class-methods/syntax/class-decl.template @@ -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 }*/ +} diff --git a/src/class-methods/syntax/class-expr.template b/src/class-methods/syntax/class-expr.template new file mode 100644 index 0000000000..7a0c64a32f --- /dev/null +++ b/src/class-methods/syntax/class-expr.template @@ -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- +features: [class] +---*/ + +var C = class { + /*{ methods }*/ +};