mirror of https://github.com/tc39/test262.git
Merge pull request #1303 from bocoup/classfields
classfields: eval early errors
This commit is contained in:
commit
fafd465454
src/class-fields
eval-err-contains-arguments.caseeval-err-contains-newcall.caseeval-err-contains-supercall-1.caseeval-err-contains-supercall-2.caseeval-err-contains-supercall.caseeval-err-contains-superproperty-1.caseeval-err-contains-superproperty-2.case
initializer-eval-super
cls-decl-fields-eval.templatecls-decl-fields-indirect-eval.templatecls-expr-fields-eval.templatecls-expr-fields-indirect-eval.template
initializer-eval
test/language
expressions/class
fields-derived-cls-direct-eval-err-contains-supercall-1.jsfields-derived-cls-direct-eval-err-contains-supercall-2.jsfields-derived-cls-direct-eval-err-contains-supercall.jsfields-derived-cls-direct-eval-err-contains-superproperty-1.jsfields-derived-cls-direct-eval-err-contains-superproperty-2.jsfields-derived-cls-indirect-eval-err-contains-supercall-1.jsfields-derived-cls-indirect-eval-err-contains-supercall-2.jsfields-derived-cls-indirect-eval-err-contains-supercall.jsfields-derived-cls-indirect-eval-err-contains-superproperty-1.jsfields-derived-cls-indirect-eval-err-contains-superproperty-2.jsfields-direct-eval-err-contains-arguments.jsfields-direct-eval-err-contains-newcall.jsfields-indirect-eval-err-contains-arguments.jsfields-indirect-eval-err-contains-newcall.js
statements/class
fields-derived-cls-direct-eval-err-contains-supercall-1.jsfields-derived-cls-direct-eval-err-contains-supercall-2.jsfields-derived-cls-direct-eval-err-contains-supercall.jsfields-derived-cls-direct-eval-err-contains-superproperty-1.jsfields-derived-cls-direct-eval-err-contains-superproperty-2.jsfields-derived-cls-indirect-eval-err-contains-supercall-1.jsfields-derived-cls-indirect-eval-err-contains-supercall-2.jsfields-derived-cls-indirect-eval-err-contains-supercall.jsfields-derived-cls-indirect-eval-err-contains-superproperty-1.jsfields-derived-cls-indirect-eval-err-contains-superproperty-2.jsfields-direct-eval-err-contains-arguments.jsfields-direct-eval-err-contains-newcall.jsfields-indirect-eval-err-contains-arguments.jsfields-indirect-eval-err-contains-newcall.js
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `arguments` in StatementList of eval
|
||||||
|
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
|
||||||
|
|
||||||
|
It is a Syntax Error if ContainsArguments of StatementList is true.
|
||||||
|
...
|
||||||
|
|
||||||
|
Static Semantics: ContainsArguments
|
||||||
|
IdentifierReference : Identifier
|
||||||
|
|
||||||
|
1. If the StringValue of Identifier is "arguments", return true.
|
||||||
|
...
|
||||||
|
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
arguments
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
ReferenceError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `new.call` in StatementList of eval
|
||||||
|
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 Functions
|
||||||
|
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
|
||||||
|
ScriptBody:StatementList
|
||||||
|
|
||||||
|
It is a Syntax Error if StatementList Contains NewTarget.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
new.call
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `super()` in StatementList of eval
|
||||||
|
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.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval-super
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
super()
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `super().x` in StatementList of eval
|
||||||
|
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 SuperCall.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval-super
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
super().x
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `super()` in StatementList of eval
|
||||||
|
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.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval-super
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
super()
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `super().x` in StatementList of eval
|
||||||
|
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.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval-super
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
super.x
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: error if `super().x` in StatementList of eval
|
||||||
|
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.
|
||||||
|
features: [class-fields]
|
||||||
|
template: initializer-eval-super
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- initializer
|
||||||
|
super['x']
|
||||||
|
//- earlyerror
|
||||||
|
SyntaxError
|
||||||
|
//- executionerror
|
||||||
|
SyntaxError
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/statements/class/fields-derived-cls-direct-
|
||||||
|
name: direct eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; /*{ initializer }*/;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ earlyerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/statements/class/fields-derived-cls-indirect-
|
||||||
|
name: indirect eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; /*{ initializer }*/;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ executionerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/expressions/class/fields-derived-cls-direct-
|
||||||
|
name: direct eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; /*{ initializer }*/;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ earlyerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/expressions/class/fields-derived-cls-indirect-
|
||||||
|
name: indirect eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; /*{ initializer }*/;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ executionerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/statements/class/fields-direct-
|
||||||
|
name: direct eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = eval('executed = true; /*{ initializer }*/;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ earlyerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/statements/class/fields-indirect-
|
||||||
|
name: indirect eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = (0, eval)('executed = true; /*{ initializer }*/;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ executionerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/expressions/class/fields-direct-
|
||||||
|
name: direct eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = eval('executed = true; /*{ initializer }*/;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ earlyerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (C) 2017 Valerie Young. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
path: language/expressions/class/fields-indirect-
|
||||||
|
name: indirect eval
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = (0, eval)('executed = true; /*{ initializer }*/;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(/*{ executionerror }*/, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 SuperCall.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; super().x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; super.x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = eval('executed = true; super["x"];';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 SuperCall.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; super().x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; super.x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
A = class {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class extends A {
|
||||||
|
x = (0, eval)('executed = true; super["x"];';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,36 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-arguments.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `arguments` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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
|
||||||
|
|
||||||
|
It is a Syntax Error if ContainsArguments of StatementList is true.
|
||||||
|
...
|
||||||
|
|
||||||
|
Static Semantics: ContainsArguments
|
||||||
|
IdentifierReference : Identifier
|
||||||
|
|
||||||
|
1. If the StringValue of Identifier is "arguments", return true.
|
||||||
|
...
|
||||||
|
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = eval('executed = true; arguments;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,35 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-newcall.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-expr-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `new.call` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 Functions
|
||||||
|
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
|
||||||
|
ScriptBody:StatementList
|
||||||
|
|
||||||
|
It is a Syntax Error if StatementList Contains NewTarget.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = eval('executed = true; new.call;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,36 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-arguments.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `arguments` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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
|
||||||
|
|
||||||
|
It is a Syntax Error if ContainsArguments of StatementList is true.
|
||||||
|
...
|
||||||
|
|
||||||
|
Static Semantics: ContainsArguments
|
||||||
|
IdentifierReference : Identifier
|
||||||
|
|
||||||
|
1. If the StringValue of Identifier is "arguments", return true.
|
||||||
|
...
|
||||||
|
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = (0, eval)('executed = true; arguments;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,35 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-newcall.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-expr-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `new.call` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 Functions
|
||||||
|
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
|
||||||
|
ScriptBody:StatementList
|
||||||
|
|
||||||
|
It is a Syntax Error if StatementList Contains NewTarget.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
C = class {
|
||||||
|
x = (0, eval)('executed = true; new.call;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 SuperCall.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; super().x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; super.x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = eval('executed = true; super["x"];';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 SuperCall.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; super().x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-supercall.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super()` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; super();';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-1.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; super.x;';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,37 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-superproperty-2.case
|
||||||
|
// - src/class-fields/initializer-eval-super/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
class A = {}
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C extends A = {
|
||||||
|
x = (0, eval)('executed = true; super["x"];';
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,36 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-arguments.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `arguments` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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
|
||||||
|
|
||||||
|
It is a Syntax Error if ContainsArguments of StatementList is true.
|
||||||
|
...
|
||||||
|
|
||||||
|
Static Semantics: ContainsArguments
|
||||||
|
IdentifierReference : Identifier
|
||||||
|
|
||||||
|
1. If the StringValue of Identifier is "arguments", return true.
|
||||||
|
...
|
||||||
|
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = eval('executed = true; arguments;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,35 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-newcall.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-decl-fields-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `new.call` in StatementList of eval (direct eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 Functions
|
||||||
|
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
|
||||||
|
ScriptBody:StatementList
|
||||||
|
|
||||||
|
It is a Syntax Error if StatementList Contains NewTarget.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = eval('executed = true; new.call;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, false);
|
|
@ -0,0 +1,36 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-arguments.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `arguments` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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
|
||||||
|
|
||||||
|
It is a Syntax Error if ContainsArguments of StatementList is true.
|
||||||
|
...
|
||||||
|
|
||||||
|
Static Semantics: ContainsArguments
|
||||||
|
IdentifierReference : Identifier
|
||||||
|
|
||||||
|
1. If the StringValue of Identifier is "arguments", return true.
|
||||||
|
...
|
||||||
|
For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = (0, eval)('executed = true; arguments;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
|
@ -0,0 +1,35 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-fields/eval-err-contains-newcall.case
|
||||||
|
// - src/class-fields/initializer-eval/cls-decl-fields-indirect-eval.template
|
||||||
|
/*---
|
||||||
|
description: error if `new.call` in StatementList of eval (indirect eval)
|
||||||
|
esid: sec-performeval-rules-in-initializer
|
||||||
|
features: [class-fields]
|
||||||
|
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 Functions
|
||||||
|
These static semantics are applied by PerformEval when a direct eval call occurs outside of any function.
|
||||||
|
ScriptBody:StatementList
|
||||||
|
|
||||||
|
It is a Syntax Error if StatementList Contains NewTarget.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var executed = false;
|
||||||
|
class C = {
|
||||||
|
x = (0, eval)('executed = true; new.call;');
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
new C();
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(executed, true);
|
Loading…
Reference in New Issue