mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Generate tests
This commit is contained in:
parent
dd80cd2ea9
commit
21cdcb85d1
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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 A = class {}
|
||||
var C = class extends A {
|
||||
x = (0, eval)('() => super.x;');
|
||||
};
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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 A = class {}
|
||||
var C = class extends A {
|
||||
x = (0, eval)('() => super["x"];');
|
||||
};
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.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 A = class {}
|
||||
var C = class extends A {
|
||||
x = (0, eval)('() => super()["x"];');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.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 A = class {}
|
||||
var C = class extends A {
|
||||
x = (0, eval)('() => super().x;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-arrow-body.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 A = class {}
|
||||
var C = class extends A {
|
||||
x = (0, eval)('() => super();');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
let executed = false;
|
||||
let C = class {
|
||||
x = eval('executed = true; () => arguments;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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;
|
||||
var C = class {
|
||||
x = eval('executed = true; () => new.target;');
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(executed, true);
|
||||
assert.sameValue(c.x(), undefined);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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 C = class {
|
||||
x = (0, eval)('() => arguments;');
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new C().x();
|
||||
});
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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 C = class {
|
||||
x = (0, eval)('() => new.target;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,37 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: super.x in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
};
|
||||
|
||||
new C().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: super['x'] in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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"];');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
};
|
||||
|
||||
new C().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super()['x']` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super().x` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super()` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: super.x in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 A = class {}
|
||||
var C = class extends A {
|
||||
#x = (0, eval)('() => super.x;');
|
||||
};
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: super['x'] in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 A = class {}
|
||||
var C = class extends A {
|
||||
#x = (0, eval)('() => super["x"];');
|
||||
};
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super()['x']` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 A = class {}
|
||||
var C = class extends A {
|
||||
#x = (0, eval)('() => super()["x"];');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 A = class {}
|
||||
var C = class extends A {
|
||||
#x = (0, eval)('() => super().x;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `super()` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 A = class {}
|
||||
var C = class extends A {
|
||||
#x = (0, eval)('() => super();');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 C = class {
|
||||
#x = eval('() => arguments;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
@ -0,0 +1,37 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, class-fields-private]
|
||||
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;
|
||||
var C = class {
|
||||
#x = eval('executed = true; () => new.target;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(executed, true);
|
||||
assert.sameValue(c.x(), undefined);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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 C = class {
|
||||
#x = (0, eval)('() => arguments;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new C().x();
|
||||
});
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, class-fields-private]
|
||||
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 C = class {
|
||||
#x = (0, eval)('() => new.target;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (arrow function expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, arrow-function]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => {
|
||||
var t = () => arguments;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-arrow-fnc-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (arrow function expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, arrow-function]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => {
|
||||
var t = () => super();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-comp-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
[x] = () => arguments;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-comp-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
[x] = () => super();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-nested.template
|
||||
/*---
|
||||
description: 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);
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-eval-nested.template
|
||||
/*---
|
||||
description: 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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.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);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-eval-nested.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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: 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);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: 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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.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);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-fields-indirect-eval-nested.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);
|
@ -0,0 +1,39 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
let executed = false;
|
||||
let C = class {
|
||||
x = () => {
|
||||
let f = eval('executed = true; arguments;');
|
||||
f();
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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;
|
||||
var C = class {
|
||||
x = eval('executed = true; new.target;');
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(executed, true);
|
||||
assert.sameValue(c.x, undefined);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-equality-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (equality expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => {} == arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-equality-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (equality expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => {} == super();
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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;
|
||||
var C = class {
|
||||
x = () => (0, eval)('executed = true; arguments;');
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,35 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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;
|
||||
var C = class {
|
||||
x = (0, eval)('executed = true; new.target;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => super();
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (private field, arrow function expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, arrow-function, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => {
|
||||
var t = () => arguments;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-arrow-fnc-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (private field, arrow function expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, arrow-function, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => {
|
||||
var t = () => super();
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: super.x in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: super['x'] in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `super()['x']` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `super().x` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `super()` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: super.x in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: super['x'] in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `super()['x']` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `super().x` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `super()` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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);
|
@ -0,0 +1,39 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `arguments` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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;
|
||||
var C = class {
|
||||
#x = () => eval('executed = true; arguments;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-eval-nested.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, class-fields-private]
|
||||
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;
|
||||
var C = class {
|
||||
#x = eval('executed = true; new.target;');
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(executed, true);
|
||||
assert.sameValue(c.x, undefined);
|
@ -0,0 +1,39 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `arguments` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
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;
|
||||
var C = class {
|
||||
#x = () => (0, eval)('executed = true; arguments;');
|
||||
x() {
|
||||
this.#x();
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,35 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-expr-private-fields-indirect-eval-nested.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, class-fields-private]
|
||||
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;
|
||||
var C = class {
|
||||
#x = (0, eval)('executed = true; new.target;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (ClassElementName PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (ClassElementName PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-ternary-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (private field, ternary expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => true ? {} : arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-ternary-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (private field, ternary expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => true ? {} : super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-typeof-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (private field, typeof expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => typeof arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-private-typeof-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (private field, typeof expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
#x = () => typeof super();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public, computed-property-names]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
static [x] = () => arguments;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-comp-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static computed ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public, computed-property-names]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var x = "string";
|
||||
var C = class {
|
||||
static [x] = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static x = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static x = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-private-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static #x = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-private-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static PrivateName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-private]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static #x = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (static string literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static 'x' = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-static-string-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (static string literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public, class-static-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
static 'x' = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (string literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
'x' = () => arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-string-literal-name-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (string literal ClassElementName)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
'x' = () => super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-ternary-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (ternary expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => true ? {} : arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-ternary-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (ternary expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => true ? {} : super();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-typeof-nested.template
|
||||
/*---
|
||||
description: Syntax error if `arguments` used in class field (typeof expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if ContainsArguments of Initializer 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.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => typeof arguments;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/init-err-contains-super.case
|
||||
// - src/class-elements/initializer-error/cls-expr-fields-typeof-nested.template
|
||||
/*---
|
||||
description: Syntax error if `super()` used in class field (typeof expression)
|
||||
esid: sec-class-definitions-static-semantics-early-errors
|
||||
features: [class, class-fields-public]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
FieldDefinition:
|
||||
PropertyNameInitializeropt
|
||||
|
||||
- It is a Syntax Error if Initializer is present and Initializer Contains SuperCall is true.
|
||||
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var C = class {
|
||||
x = () => typeof super();
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-decl-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-decl-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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().x();
|
||||
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,29 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-eval-arrow-body.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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-1.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-decl-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class A {}
|
||||
class C extends A {
|
||||
x = (0, eval)('() => super.x;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,31 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-contains-superproperty-2.case
|
||||
// - src/class-elements/initializer-eval-super-property/cls-decl-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: 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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class A {}
|
||||
class C extends A {
|
||||
x = (0, eval)('() => super["x"];');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-1.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-indirect-eval-arrow-body.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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class A {}
|
||||
class C extends A {
|
||||
x = (0, eval)('() => super()["x"];');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall-2.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-indirect-eval-arrow-body.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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class A {}
|
||||
class C extends A {
|
||||
x = (0, eval)('() => super().x;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-supercall.case
|
||||
// - src/class-elements/initializer-eval-super-call/cls-decl-fields-indirect-eval-arrow-body.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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class A {}
|
||||
class C extends A {
|
||||
x = (0, eval)('() => super();');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-decl-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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().x();
|
||||
});
|
||||
|
||||
assert.sameValue(executed, false);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-decl-fields-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (direct eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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.target;');
|
||||
}
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.sameValue(executed, true);
|
||||
assert.sameValue(c.x(), undefined);
|
@ -0,0 +1,34 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-arguments.case
|
||||
// - src/class-elements/initializer-eval-arguments/cls-decl-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `arguments` 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
|
||||
|
||||
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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
x = (0, eval)('() => arguments;');
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new C().x();
|
||||
});
|
||||
assert.sameValue(executed, true);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/class-elements/eval-err-contains-newtarget.case
|
||||
// - src/class-elements/initializer-eval-newtarget/cls-decl-fields-indirect-eval-arrow-body.template
|
||||
/*---
|
||||
description: error if `new.target` in StatementList of eval (indirect eval)
|
||||
esid: sec-performeval-rules-in-initializer
|
||||
features: [class, new.target, 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 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.
|
||||
|
||||
---*/
|
||||
|
||||
|
||||
class C {
|
||||
x = (0, eval)('() => new.target;');
|
||||
}
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
new C().x();
|
||||
});
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user