diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..17351e3ac1 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..6c079ff81e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super().x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js new file mode 100644 index 0000000000..5e4364c58c --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-eval.template +/*--- +description: error if `super()` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..9bcac948c1 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template +/*--- +description: error if `super.x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super.x;'); +}; + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..0afe73ea33 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-eval.template +/*--- +description: error if super['x'] in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = eval('executed = true; super["x"];'); +}; + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..f4532dc6ac --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..cb9d794e6e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super().x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js new file mode 100644 index 0000000000..9727b8b82e --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super()` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..91ea12f15b --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if `super.x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super.x;'); +}; + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..680bba0434 --- /dev/null +++ b/test/language/expressions/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-expr-private-fields-indirect-eval.template +/*--- +description: error if super['x'] in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +var A = class {} +var C = class extends A { + #x = (0, eval)('executed = true; super["x"];'); +}; + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js index a8375776ce..899f3e41b3 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-1.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super()['x']` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super()["x"];'); + x = (0, eval)('executed = true; super()["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js index 586a59e3b0..157a843836 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall-2.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super().x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -19,7 +19,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super().x;'); + x = (0, eval)('executed = true; super().x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js index d4999d75df..605c574ec3 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-supercall.case -// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-call/cls-decl-fields-indirect-eval.template /*--- description: error if `super()` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super();'); + x = (0, eval)('executed = true; super();'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js index ddeafb7253..222abc22f6 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-1.case -// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template /*--- description: error if `super.x` in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -26,7 +26,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super.x;'); + x = (0, eval)('executed = true; super.x;'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js index 2ed9f8c6a1..cb54407062 100644 --- a/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js +++ b/test/language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -1,6 +1,6 @@ // This file was procedurally generated from the following sources: // - src/class-fields/eval-err-contains-superproperty-2.case -// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +// - src/class-fields/initializer-eval-super-property/cls-decl-fields-indirect-eval.template /*--- description: error if super['x'] in StatementList of eval (indirect eval) esid: sec-performeval-rules-in-initializer @@ -23,7 +23,7 @@ info: | var executed = false; class A {} class C extends A { - #x = (0, eval)('executed = true; super["x"];'); + x = (0, eval)('executed = true; super["x"];'); } assert.throws(SyntaxError, function() { diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..5c6f0e3d4c --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..200f61f719 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super().x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js new file mode 100644 index 0000000000..b539515995 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-eval.template +/*--- +description: error if `super()` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..f649a7460e --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-1.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template +/*--- +description: error if `super.x` in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super.x;'); +} + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..5247e1b4a2 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-direct-eval-err-contains-superproperty-2.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-eval.template +/*--- +description: error if super['x'] in StatementList of eval (direct eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = eval('executed = true; super["x"];'); +} + +new C(); + +assert.sameValue(executed, true); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js new file mode 100644 index 0000000000..a8375776ce --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-1.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super()['x']` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super()["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js new file mode 100644 index 0000000000..586a59e3b0 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall-2.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall-2.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super().x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super().x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js new file mode 100644 index 0000000000..d4999d75df --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-supercall.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-supercall.case +// - src/class-fields/initializer-eval-super-call/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super()` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Constructor Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of the constructor method of a ClassDeclaration or ClassExpression. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperCall. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super();'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js new file mode 100644 index 0000000000..ddeafb7253 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-1.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-1.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if `super.x` in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + Additional Early Error Rules for Eval Inside Initializer + These static semantics are applied by PerformEval when a direct eval call occurs inside a class field initializer. + ScriptBody : StatementList + + ... + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super.x;'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false); diff --git a/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js new file mode 100644 index 0000000000..2ed9f8c6a1 --- /dev/null +++ b/test/language/statements/class/fields-private-derived-cls-indirect-eval-err-contains-superproperty-2.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/class-fields/eval-err-contains-superproperty-2.case +// - src/class-fields/initializer-eval-super-property/cls-decl-private-fields-indirect-eval.template +/*--- +description: error if super['x'] in StatementList of eval (indirect eval) +esid: sec-performeval-rules-in-initializer +features: [class, class-fields-public] +flags: [generated] +info: | + The remaining eval rules apply as outside a constructor, inside a method, and inside a function. + + Additional Early Error Rules for Eval Outside Methods + + These static semantics are applied by PerformEval when a direct eval call occurs outside of a MethodDefinition. + + ScriptBody : StatementList + + It is a Syntax Error if StatementList Contains SuperProperty. + +---*/ + + +var executed = false; +class A {} +class C extends A { + #x = (0, eval)('executed = true; super["x"];'); +} + +assert.throws(SyntaxError, function() { + new C(); +}); + +assert.sameValue(executed, false);