Skip to content
Snippets Groups Projects
Commit 2d4ac25f authored by Thomas Wood's avatar Thomas Wood
Browse files

Add feature flags for `new.target`

Additionally removed the `arrow-function` feature for
test/language/eval-code/direct/new.target-fn.js as it is not testing
arrow-functions, but they are mentioned in the preamble.
parent d1ad8e8f
No related branches found
No related tags found
No related merge requests found
Showing
with 20 additions and 9 deletions
...@@ -16,7 +16,7 @@ info: | ...@@ -16,7 +16,7 @@ info: |
ScriptBody:StatementList ScriptBody:StatementList
It is a Syntax Error if StatementList Contains NewTarget. It is a Syntax Error if StatementList Contains NewTarget.
features: [class, class-fields-public] features: [class, class-fields-public, new.target]
template: initializer-eval-newtarget template: initializer-eval-newtarget
---*/ ---*/
......
...@@ -21,7 +21,7 @@ info: | ...@@ -21,7 +21,7 @@ info: |
... ...
3. If func is either undefined or null, return undefined. 3. If func is either undefined or null, return undefined.
... ...
features: [Proxy, Reflect, Reflect.construct] features: [Proxy, Reflect, Reflect.construct, new.target]
---*/ ---*/
var calls = 0; var calls = 0;
......
...@@ -10,7 +10,7 @@ info: | ...@@ -10,7 +10,7 @@ info: |
7. If trap is undefined, then 7. If trap is undefined, then
b. Return Construct(target, argumentsList, newTarget). b. Return Construct(target, argumentsList, newTarget).
features: [Proxy, Reflect, Reflect.construct] features: [Proxy, Reflect, Reflect.construct, new.target]
---*/ ---*/
var calls = 0; var calls = 0;
......
...@@ -21,7 +21,7 @@ info: | ...@@ -21,7 +21,7 @@ info: |
... ...
3. If func is either undefined or null, return undefined. 3. If func is either undefined or null, return undefined.
... ...
features: [Proxy, Reflect, Reflect.construct] features: [Proxy, Reflect, Reflect.construct, new.target]
---*/ ---*/
var calls = 0; var calls = 0;
......
...@@ -11,7 +11,7 @@ info: | ...@@ -11,7 +11,7 @@ info: |
code containing NewTarget is eval code that is being processed by a direct code containing NewTarget is eval code that is being processed by a direct
eval that is contained in function code that is not the function code of an eval that is contained in function code that is not the function code of an
ArrowFunction. ArrowFunction.
features: [arrow-function] features: [arrow-function, new.target]
---*/ ---*/
var caught; var caught;
......
...@@ -11,7 +11,7 @@ info: | ...@@ -11,7 +11,7 @@ info: |
code containing NewTarget is eval code that is being processed by a direct code containing NewTarget is eval code that is being processed by a direct
eval that is contained in function code that is not the function code of an eval that is contained in function code that is not the function code of an
ArrowFunction. ArrowFunction.
features: [arrow-function] features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -9,6 +9,7 @@ info: | ...@@ -9,6 +9,7 @@ info: |
code containing NewTarget is eval code that is being processed by a direct code containing NewTarget is eval code that is being processed by a direct
eval that is contained in function code that is not the function code of an eval that is contained in function code that is not the function code of an
ArrowFunction. ArrowFunction.
features: [new.target]
---*/ ---*/
var caught; var caught;
......
...@@ -10,6 +10,7 @@ info: | ...@@ -10,6 +10,7 @@ info: |
code containing NewTarget is eval code that is being processed by a direct code containing NewTarget is eval code that is being processed by a direct
eval that is contained in function code that is not the function code of an eval that is contained in function code that is not the function code of an
ArrowFunction. ArrowFunction.
features: [new.target]
---*/ ---*/
var caught; var caught;
......
...@@ -14,6 +14,7 @@ description: > ...@@ -14,6 +14,7 @@ description: >
The non-normative note elaborates on the "scope" argument: The non-normative note elaborates on the "scope" argument:
An ArrowFunction does not define local bindings for arguments, super, this, or new.target. Any reference to arguments, super, or this within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an ArrowFunction may contain references to super, the function object created in step 4 is not made into a method by performing MakeMethod. An ArrowFunction that references super is always contained within a non-ArrowFunction and the necessary state to implement super is accessible via the scope that is captured by the function object of the ArrowFunction. An ArrowFunction does not define local bindings for arguments, super, this, or new.target. Any reference to arguments, super, or this within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an ArrowFunction may contain references to super, the function object created in step 4 is not made into a method by performing MakeMethod. An ArrowFunction that references super is always contained within a non-ArrowFunction and the necessary state to implement super is accessible via the scope that is captured by the function object of the ArrowFunction.
features: [new.target]
---*/ ---*/
function F() { function F() {
......
...@@ -14,6 +14,7 @@ description: > ...@@ -14,6 +14,7 @@ description: >
The non-normative note elaborates on the "scope" argument: The non-normative note elaborates on the "scope" argument:
An ArrowFunction does not define local bindings for arguments, super, this, or new.target. Any reference to arguments, super, or this within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an ArrowFunction may contain references to super, the function object created in step 4 is not made into a method by performing MakeMethod. An ArrowFunction that references super is always contained within a non-ArrowFunction and the necessary state to implement super is accessible via the scope that is captured by the function object of the ArrowFunction. An ArrowFunction does not define local bindings for arguments, super, this, or new.target. Any reference to arguments, super, or this within an ArrowFunction must resolve to a binding in a lexically enclosing environment. Typically this will be the Function Environment of an immediately enclosing function. Even though an ArrowFunction may contain references to super, the function object created in step 4 is not made into a method by performing MakeMethod. An ArrowFunction that references super is always contained within a non-ArrowFunction and the necessary state to implement super is accessible via the scope that is captured by the function object of the ArrowFunction.
features: [new.target]
---*/ ---*/
var functionInvocationCount = 0; var functionInvocationCount = 0;
......
...@@ -21,6 +21,7 @@ info: | ...@@ -21,6 +21,7 @@ info: |
negative: negative:
phase: parse phase: parse
type: ReferenceError type: ReferenceError
features: [new.target]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
......
...@@ -21,6 +21,7 @@ info: | ...@@ -21,6 +21,7 @@ info: |
negative: negative:
phase: parse phase: parse
type: ReferenceError type: ReferenceError
features: [new.target]
---*/ ---*/
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
......
...@@ -9,6 +9,7 @@ info: | ...@@ -9,6 +9,7 @@ info: |
[...] [...]
8. Return ? EvaluateDirectCall(func, thisValue, Arguments, tailCall). 8. Return ? EvaluateDirectCall(func, thisValue, Arguments, tailCall).
features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -7,6 +7,7 @@ description: Value when invoked via `Function.prototype.apply` ...@@ -7,6 +7,7 @@ description: Value when invoked via `Function.prototype.apply`
info: | info: |
[...] [...]
5. Return ? Call(func, thisArg, argList). 5. Return ? Call(func, thisArg, argList).
features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -7,6 +7,7 @@ description: Value when invoked via `Function.prototype.call` ...@@ -7,6 +7,7 @@ description: Value when invoked via `Function.prototype.call`
info: | info: |
[...] [...]
5. Return ? Call(func, thisArg, argList). 5. Return ? Call(func, thisArg, argList).
features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -18,6 +18,7 @@ info: | ...@@ -18,6 +18,7 @@ info: |
1. Let exprRef be the result of evaluating Expression. 1. Let exprRef be the result of evaluating Expression.
2. Return ? GetValue(exprRef). 2. Return ? GetValue(exprRef).
features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -21,6 +21,7 @@ info: | ...@@ -21,6 +21,7 @@ info: |
7.3.13 Construct (F [ , argumentsList [ , newTarget ]]) 7.3.13 Construct (F [ , argumentsList [ , newTarget ]])
1. If newTarget was not passed, let newTarget be F. 1. If newTarget was not passed, let newTarget be F.
features: [new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -7,7 +7,7 @@ description: Value when invoked via `Reflect.apply` ...@@ -7,7 +7,7 @@ description: Value when invoked via `Reflect.apply`
info: | info: |
[...] [...]
5. Return ? Call(target, thisArgument, args). 5. Return ? Call(target, thisArgument, args).
features: [Reflect] features: [Reflect, new.target]
---*/ ---*/
var newTarget = null; var newTarget = null;
......
...@@ -9,7 +9,7 @@ info: | ...@@ -9,7 +9,7 @@ info: |
2. If newTarget is not present, let newTarget be target. 2. If newTarget is not present, let newTarget be target.
[...] [...]
5. Return ? Construct(target, args, newTarget). 5. Return ? Construct(target, args, newTarget).
features: [Reflect] features: [Reflect, new.target]
---*/ ---*/
var customNewTarget = function() {}; var customNewTarget = function() {};
......
...@@ -11,7 +11,7 @@ info: | ...@@ -11,7 +11,7 @@ info: |
[...] [...]
6. Let result be ? Construct(func, argList, newTarget). 6. Let result be ? Construct(func, argList, newTarget).
[...] [...]
features: [class] features: [class, new.target]
---*/ ---*/
var baseNewTarget, parentNewTarget; var baseNewTarget, parentNewTarget;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment