always-non-strict-strict.js |
---
description: Strictness of direct eval is not dependent on strictness of caller
esid: sec-strict-mode-code
info: |
Eval code is strict mode code if it begins with a Directive Prologue that
contains a Use Strict Directive or if the call to eval is a direct eval
that is contained in strict mode code.
flags: [onlyStrict]
--- |
745 |
block-decl-strict.js |
---
description: AnnexB extension not honored in strict mode
es6id: B.3.3.2
info: |
Block statement in eval code containing a function declaration
B.3.3.3 Changes to EvalDeclarationInstantiation
1. If strict is false, then
--- |
569 |
browser.js |
|
0 |
cptn-nrml-empty-block.js |
---
info: |
If Result(3).type is normal and its completion value is empty, then return
the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T1
description: Block statement
--- |
404 |
cptn-nrml-empty-do-while.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T6
description: do-while statement
--- |
422 |
cptn-nrml-empty-empty.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T3
description: Empty statement
--- |
403 |
cptn-nrml-empty-for.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T8
description: for statement
--- |
423 |
cptn-nrml-empty-if.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T4
description: If statement
--- |
411 |
cptn-nrml-empty-switch.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T5
description: Switch statement
--- |
414 |
cptn-nrml-empty-var.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T2
description: Var statement
--- |
409 |
cptn-nrml-empty-while.js |
---
info: |
If Result(3).type is normal and its completion value is empty,
then return the value undefined
esid: sec-performeval
es5id: 15.1.2.1_A3.2_T7
description: while statement
--- |
415 |
cptn-nrml-expr-obj.js |
---
info: |
If Result(3).type is normal and its completion value is a value V,
then return the value V
esid: sec-performeval
es5id: 15.1.2.1_A3.1_T2
description: Expression statement. Eval return object value
--- |
531 |
cptn-nrml-expr-prim.js |
---
info: |
If Result(3).type is normal and its completion value is a value V,
then return the value V
esid: sec-performeval
es5id: 15.1.2.1_A3.1_T1
description: Expression statement. Eval return primitive value
--- |
639 |
export.js |
---
description: The `export` declaration may not appear within eval code
esid: sec-scripts
flags: [module]
info: |
Eval code is the source text supplied to the built-in eval function. More
precisely, if the parameter to the built-in eval function is a String, it
is treated as an ECMAScript Script. The eval code for a particular
invocation of eval is the global code portion of that Script.
A.5 Scripts and Modules
Script:
ScriptBodyopt
ScriptBody:
StatementList
--- |
790 |
global-env-rec-catch.js |
---
es5id: 10.4.2-1-3
description: >
Indirect call to eval has context set to global context (catch
block)
--- |
636 |
global-env-rec-eval.js |
---
es5id: 10.4.2-1-5
description: >
Indirect call to eval has context set to global context (inside
another eval)
--- |
641 |
global-env-rec-fun.js |
---
es5id: 10.4.2-1-2
description: >
Indirect call to eval has context set to global context (nested
function)
--- |
601 |
global-env-rec-with.js |
---
es5id: 10.4.2-1-4
description: >
Indirect call to eval has context set to global context (with
block)
flags: [noStrict]
--- |
617 |
global-env-rec.js |
---
es5id: 10.4.2-1-1
description: Indirect call to eval has context set to global context
--- |
442 |
import.js |
---
description: The `import` declaration may not appear within eval code
esid: sec-scripts
flags: [module]
info: |
Eval code is the source text supplied to the built-in eval function. More
precisely, if the parameter to the built-in eval function is a String, it
is treated as an ECMAScript Script. The eval code for a particular
invocation of eval is the global code portion of that Script.
A.5 Scripts and Modules
Script:
ScriptBodyopt
ScriptBody:
StatementList
--- |
798 |
lex-env-distinct-cls.js |
---
esid: sec-performeval
description: >
Indirect eval code creates a new declarative environment for
lexically-scoped declarations (class)
info: |
[...]
9. If direct is true, then
[...]
10. Else,
a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
[...]
features: [class]
--- |
887 |
lex-env-distinct-const.js |
---
esid: sec-performeval
description: >
Indirect eval code creates a new declarative environment for
lexically-scoped declarations (const)
info: |
[...]
9. If direct is true, then
[...]
10. Else,
a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
[...]
features: [const]
--- |
912 |
lex-env-distinct-let.js |
---
esid: sec-performeval
description: >
Indirect eval code creates a new declarative environment for
lexically-scoped declarations (let)
info: |
[...]
9. If direct is true, then
[...]
10. Else,
a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
[...]
features: [let]
--- |
876 |
lex-env-heritage.js |
---
esid: sec-performeval
description: >
Indirect eval code sets the new declarative environment's outer environment
to the global environment.
info: |
[...]
9. If direct is true, then
[...]
10. Else,
a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
[...]
features: [let]
--- |
790 |
lex-env-no-init-cls.js |
---
esid: sec-performeval
description: >
Indirect eval code creates `class` bindings prior to evaluation, but does
not initialize them.
info: |
[...]
14. For each element d in lexDeclarations do
a. NOTE Lexically declared names are only instantiated here but not
initialized.
b. For each element dn of the BoundNames of d do
i. If IsConstantDeclaration of d is true, then
1. Perform ? lexEnvRec.CreateImmutableBinding(dn, true).
ii. Else,
2. Perform ? lexEnvRec.CreateMutableBinding(dn, false).
[...]
features: [class]
--- |
869 |
lex-env-no-init-const.js |
---
esid: sec-performeval
description: >
Indirect eval code creates `const` bindings prior to evaluation but does
not initialize them.
info: |
[...]
14. For each element d in lexDeclarations do
a. NOTE Lexically declared names are only instantiated here but not
initialized.
b. For each element dn of the BoundNames of d do
i. If IsConstantDeclaration of d is true, then
1. Perform ? lexEnvRec.CreateImmutableBinding(dn, true).
ii. Else,
2. Perform ? lexEnvRec.CreateMutableBinding(dn, false).
[...]
features: [const]
--- |
873 |
lex-env-no-init-let.js |
---
esid: sec-performeval
description: >
Indirect eval code creates `let` bindings prior to evaluation but does not
initialize them.
info: |
[...]
14. For each element d in lexDeclarations do
a. NOTE Lexically declared names are only instantiated here but not
initialized.
b. For each element dn of the BoundNames of d do
i. If IsConstantDeclaration of d is true, then
1. Perform ? lexEnvRec.CreateImmutableBinding(dn, true).
ii. Else,
2. Perform ? lexEnvRec.CreateMutableBinding(dn, false).
[...]
features: [let]
--- |
860 |
new.target.js |
---
esid: sec-scripts-static-semantics-early-errors
es6id: 15.1.1
description: >
An indirect eval may not contain `new.target`
info: |
- It is a Syntax Error if StatementList Contains NewTarget unless the source
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
ArrowFunction.
features: [new.target]
--- |
1128 |
non-definable-function-with-function.js |
---
esid: sec-evaldeclarationinstantiation
es6id: 18.2.1.2
description: >
Global functions are not created if conflicting function declarations were
detected.
info: |
Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)
...
8. For each d in varDeclarations, in reverse list order do
a. If d is neither a VariableDeclaration or a ForBinding, then
i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.
ii. NOTE If there are multiple FunctionDeclarations for the same name,
the last declaration is used.
iii. Let fn be the sole element of the BoundNames of d.
iv. If fn is not an element of declaredFunctionNames, then
1. If varEnvRec is a global Environment Record, then
a. Let fnDefinable be varEnvRec.CanDeclareGlobalFunction(fn).
b. ReturnIfAbrupt(fnDefinable).
c. If fnDefinable is false, throw TypeError exception.
...
14. For each production f in functionsToInitialize, do
a. Let fn be the sole element of the BoundNames of f.
b. Let fo be the result of performing InstantiateFunctionObject for f with argument lexEnv.
c. If varEnvRec is a global Environment Record, then
i. Let status be varEnvRec.CreateGlobalFunctionBinding(fn, fo, true).
ii. ReturnIfAbrupt(status).
...
--- |
1917 |
non-definable-function-with-variable.js |
---
esid: sec-evaldeclarationinstantiation
es6id: 18.2.1.2
description: >
Global variables are not created if conflicting function declarations were
detected.
info: |
Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)
...
8. For each d in varDeclarations, in reverse list order do
a. If d is neither a VariableDeclaration or a ForBinding, then
i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.
ii. NOTE If there are multiple FunctionDeclarations for the same name, the last declaration is used.
iii. Let fn be the sole element of the BoundNames of d.
iv. If fn is not an element of declaredFunctionNames, then
1. If varEnvRec is a global Environment Record, then
a. Let fnDefinable be varEnvRec.CanDeclareGlobalFunction(fn).
b. ReturnIfAbrupt(fnDefinable).
c. If fnDefinable is false, throw TypeError exception.
...
15. For each String vn in declaredVarNames, in list order do
a. If varEnvRec is a global Environment Record, then
i. Let status be varEnvRec.CreateGlobalVarBinding(vn, true).
ii. ReturnIfAbrupt(status).
...
--- |
1732 |
non-definable-global-function.js |
---
esid: sec-evaldeclarationinstantiation
es6id: 18.2.1.2
description: Throws a TypeError if a global function cannot be defined.
info: |
Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)
...
8. For each d in varDeclarations, in reverse list order do
a. If d is neither a VariableDeclaration or a ForBinding, then
i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.
ii. NOTE If there are multiple FunctionDeclarations for the same name,
the last declaration is used.
iii. Let fn be the sole element of the BoundNames of d.
iv. If fn is not an element of declaredFunctionNames, then
1. If varEnvRec is a global Environment Record, then
a. Let fnDefinable be varEnvRec.CanDeclareGlobalFunction(fn).
b. ReturnIfAbrupt(fnDefinable).
c. If fnDefinable is false, throw TypeError exception.
...
--- |
1173 |
non-definable-global-generator.js |
---
esid: sec-evaldeclarationinstantiation
es6id: 18.2.1.2
description: Throws a TypeError if a global generator function cannot be defined.
info: |
Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)
...
8. For each d in varDeclarations, in reverse list order do
a. If d is neither a VariableDeclaration or a ForBinding, then
i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.
ii. NOTE If there are multiple FunctionDeclarations for the same name,
the last declaration is used.
iii. Let fn be the sole element of the BoundNames of d.
iv. If fn is not an element of declaredFunctionNames, then
1. If varEnvRec is a global Environment Record, then
a. Let fnDefinable be varEnvRec.CanDeclareGlobalFunction(fn).
b. ReturnIfAbrupt(fnDefinable).
c. If fnDefinable is false, throw TypeError exception.
...
features: [generators]
--- |
1207 |
non-definable-global-var.js |
---
esid: sec-evaldeclarationinstantiation
es6id: 18.2.1.2
description: Throws a TypeError if a global variable cannot be defined.
info: |
Runtime Semantics: EvalDeclarationInstantiation( body, varEnv, lexEnv, strict)
...
10. For each d in varDeclarations, do
a. If d is a VariableDeclaration or a ForBinding, then
i. For each String vn in the BoundNames of d, do
1. If vn is not an element of declaredFunctionNames, then
a. If varEnvRec is a global Environment Record, then
i. Let vnDefinable be varEnvRec.CanDeclareGlobalVar(vn).
ii. ReturnIfAbrupt(vnDefinable).
iii. If vnDefinable is false, throw TypeError exception.
...
--- |
1183 |
non-string-object.js |
---
info: If x is not a string value, return x
esid: sec-performeval
es5id: 15.1.2.1_A1.1_T2
description: Checking all objects
--- |
583 |
non-string-primitive.js |
---
info: If x is not a string value, return x
esid: sec-performeval
es5id: 15.1.2.1_A1.1_T1
description: Checking all primitives
--- |
567 |
parse-failure-1.js |
---
info: If the parse fails, throw a SyntaxError exception (but see also clause 16)
esid: sec-performeval
es5id: 15.1.2.1_A2_T1
description: >
Checking if execution of "(0,eval)("x = 1; x\u000A++"), catch SyntaxError"
passes
--- |
486 |
parse-failure-2.js |
---
info: If the parse fails, throw a SyntaxError exception (but see also clause 16)
esid: sec-performeval
es5id: 15.1.2.1_A2_T2
description: Checking if execution of "(0,eval)("x = 1; x\u000A++")" fails
negative:
phase: runtime
type: SyntaxError
--- |
466 |
parse-failure-3.js |
---
info: |
If Result(3).type is not normal, then Result(3).type must be throw.
Throw Result(3).value as an exception
esid: sec-performeval
es5id: 15.1.2.1_A3.3_T1
description: Continue statement
--- |
677 |
parse-failure-4.js |
---
info: |
If Result(3).type is not normal, then Result(3).type must be throw.
Throw Result(3).value as an exception
esid: sec-performeval
es5id: 15.1.2.1_A3.3_T2
description: Break statement
--- |
668 |
parse-failure-5.js |
---
info: |
If Result(3).type is not normal, then Result(3).type must be throw.
Throw Result(3).value as an exception
esid: sec-performeval
es5id: 15.1.2.1_A3.3_T3
description: Return statement
--- |
716 |
parse-failure-6.js |
---
esid: sec-performeval
description: For statement
info: |
...
9. Perform the following substeps in an implementation-dependent order, possibly interleaving parsing and error detection:
a. Let script be the ECMAScript code that is the result of parsing ! UTF16DecodeString(x),for the goal symbol Script.
If the parse fails, throw a SyntaxError exception. If any early errors are detected, throw a SyntaxError exception
(but see also clause 16).
...
--- |
712 |
realm.js |
---
esid: sec-performeval
es6id: 18.2.1.1
description: >
Uses the global variable envrionment of the running execution context
info: |
[...]
12. Let ctx be the running execution context. If direct is true, ctx will be
the execution context that performed the direct eval. If direct is false,
ctx will be the execution context for the invocation of the eval
function.
13. If direct is true, then
[...]
14. Else,
a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).
b. Let varEnv be evalRealm.[[GlobalEnv]].
[...]
17. Let evalCxt be a new ECMAScript code execution context.
[...]
21. Set the evalCxt's VariableEnvironment to varEnv.
[...]
24. Let result be EvalDeclarationInstantiation(body, varEnv, lexEnv,
strictEval).
features: [cross-realm]
--- |
1158 |
shell.js |
|
0 |
super-call.js |
---
esid: sec-scripts-static-semantics-early-errors
es6id: 15.1.1
description: >
An indirect eval may not contain SuperCall
info: |
- It is a Syntax Error if StatementList Contains super unless the source code
containing super 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
ArrowFunction.
features: [super]
--- |
1115 |
super-prop.js |
---
esid: sec-scripts-static-semantics-early-errors
es6id: 15.1.1
description: >
An indirect eval may not contain SuperProperty
info: |
- It is a Syntax Error if StatementList Contains super unless the source code
containing super 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
ArrowFunction.
features: [super]
--- |
1133 |
switch-case-decl-strict.js |
---
description: AnnexB extension not honored in strict mode
es6id: B.3.3.3
info: |
Function declaration in the `case` clause of a `switch` statement in eval
code
B.3.3.3 Changes to EvalDeclarationInstantiation
1. If strict is false, then
--- |
635 |
switch-dflt-decl-strict.js |
---
description: AnnexB extension not honored in strict mode
es6id: B.3.3.3
info: |
Function declaration in the `default` clause of a `switch` statement in
eval code
B.3.3.3 Changes to EvalDeclarationInstantiation
1. If strict is false, then
--- |
639 |
this-value-func.js |
---
description: >
Direct eval code has the same `this` binding as the calling context
(non-strict function scope)
esid: sec-performeval
--- |
419 |
this-value-global.js |
---
description: >
Direct eval code has the same `this` binding as the calling context (global
scope)
esid: sec-performeval
--- |
344 |
var-env-func-init-global-new.js |
---
esid: sec-evaldeclarationinstantiation
description: Initialization of new global property
info: |
[...]
15. For each production f in functionsToInitialize, do
a. Let fn be the sole element of the BoundNames of f.
b. Let fo be the result of performing InstantiateFunctionObject for f
with argument lexEnv.
c. If varEnvRec is a global Environment Record, then
i. Perform ? varEnvRec.CreateGlobalFunctionBinding(fn, fo, true).
[...]
8.1.1.4.18 CreateGlobalFunctionBinding
[...]
5. If existingProp is undefined or existingProp.[[Configurable]] is true,
then
a. Let desc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true,
[[Enumerable]]: true, [[Configurable]]: D}.
6. Else,
[...]
7. Perform ? DefinePropertyOrThrow(globalObject, N, desc).
[...]
includes: [propertyHelper.js]
--- |
1312 |
var-env-func-init-global-update-configurable.js |
---
esid: sec-evaldeclarationinstantiation
description: Modification of previously-existing configurable global property
info: |
[...]
15. For each production f in functionsToInitialize, do
a. Let fn be the sole element of the BoundNames of f.
b. Let fo be the result of performing InstantiateFunctionObject for f
with argument lexEnv.
c. If varEnvRec is a global Environment Record, then
i. Perform ? varEnvRec.CreateGlobalFunctionBinding(fn, fo, true).
[...]
8.1.1.4.18 CreateGlobalFunctionBinding
[...]
5. If existingProp is undefined or existingProp.[[Configurable]] is true,
then
a. Let desc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true,
[[Enumerable]]: true, [[Configurable]]: D}.
6. Else,
[...]
7. Perform ? DefinePropertyOrThrow(globalObject, N, desc).
[...]
includes: [propertyHelper.js]
--- |
1447 |
var-env-func-init-global-update-non-configurable.js |
---
esid: sec-evaldeclarationinstantiation
description: >
Modification of previously-existing non-configurable global property
info: |
[...]
15. For each production f in functionsToInitialize, do
a. Let fn be the sole element of the BoundNames of f.
b. Let fo be the result of performing InstantiateFunctionObject for f
with argument lexEnv.
c. If varEnvRec is a global Environment Record, then
i. Perform ? varEnvRec.CreateGlobalFunctionBinding(fn, fo, true).
[...]
8.1.1.4.18 CreateGlobalFunctionBinding
[...]
5. If existingProp is undefined or existingProp.[[Configurable]] is true,
then
[...]
6. Else,
b. Let desc be the PropertyDescriptor{[[Value]]: V }.
7. Perform ? DefinePropertyOrThrow(globalObject, N, desc).
[...]
includes: [propertyHelper.js]
--- |
1379 |
var-env-func-init-multi.js |
---
esid: sec-evaldeclarationinstantiation
description: Precedence of final declaration when bindings are duplicated
info: |
[...]
8. For each d in varDeclarations, in reverse list order do
a. If d is neither a VariableDeclaration or a ForBinding, then
i. Assert: d is either a FunctionDeclaration or a
GeneratorDeclaration.
[...]
iv. If fn is not an element of declaredFunctionNames, then
[...]
3. Insert d as the first element of functionsToInitialize.
[...]
15. For each production f in functionsToInitialize, do
a. Let fn be the sole element of the BoundNames of f.
b. Let fo be the result of performing InstantiateFunctionObject for f
with argument lexEnv.
[...]
--- |
1201 |
var-env-func-non-strict.js |
---
esid: sec-performeval
es5id: 10.4.2-2-s
description: >
Non-stict mode indirect eval code cannot instantiate functions in the
variable environment of the caller
--- |
529 |
var-env-func-strict.js |
---
esid: sec-performeval
es5id: 10.4.2.1-4-s
description: >
Strict Mode - Strict mode eval code cannot instantiate functions
in the variable environment of the caller to eval.
--- |
557 |
var-env-global-lex-non-strict.js |
---
esid: sec-evaldeclarationinstantiation
description: Variable collision with global lexical binding
info: |
[...]
5. If strict is false, then
a. If varEnvRec is a global Environment Record, then
i. For each name in varNames, do
1. If varEnvRec.HasLexicalDeclaration(name) is true, throw a
SyntaxError exception.
2. NOTE: eval will not create a global var declaration that would
be shadowed by a global lexical declaration.
[...]
features: [let]
--- |
970 |
var-env-global-lex-strict.js |
---
esid: sec-evaldeclarationinstantiation
description: No variable collision with global lexical binding
info: |
[...]
5. If strict is false, then
[...]
features: [let]
--- |
393 |
var-env-lower-lex-non-strict.js |
---
esid: sec-evaldeclarationinstantiation
description: No variable collision with lexical binding in lower scope
info: |
[...]
5. If strict is false, then
[...]
d. Repeat while thisLex is not the same as varEnv,
[...]
features: [let]
--- |
478 |
var-env-lower-lex-strict.js |
---
esid: sec-evaldeclarationinstantiation
description: No variable collision with lexical binding in lower scope
info: |
[...]
5. If strict is false, then
[...]
features: [let]
--- |
418 |
var-env-var-init-global-exstng.js |
---
esid: sec-evaldeclarationinstantiation
description: Declaration does not modify existing global property
info: |
[...]
16. For each String vn in declaredVarNames, in list order do
a. If varEnvRec is a global Environment Record, then
i. Perform ? varEnvRec.CreateGlobalVarBinding(vn, true).
[...]
8.1.1.4.17 CreateGlobalVarBinding
[...]
5. Let extensible be ? IsExtensible(globalObject).
6. If hasProperty is false and extensible is true, then
[...]
[...]
includes: [propertyHelper.js]
--- |
922 |
var-env-var-init-global-new.js |
---
esid: sec-evaldeclarationinstantiation
description: Initialization of new global property
info: |
[...]
16. For each String vn in declaredVarNames, in list order do
a. If varEnvRec is a global Environment Record, then
i. Perform ? varEnvRec.CreateGlobalVarBinding(vn, true).
[...]
8.1.1.4.17 CreateGlobalVarBinding
[...]
5. Let extensible be ? IsExtensible(globalObject).
6. If hasProperty is false and extensible is true, then
a. Perform ? ObjRec.CreateMutableBinding(N, D).
b. Perform ? ObjRec.InitializeBinding(N, undefined).
[...]
includes: [propertyHelper.js]
--- |
1008 |
var-env-var-non-strict.js |
---
esid: sec-performeval
es5id: 10.4.2-2-c-1
description: Indirect eval code cannot instantiate variable in calling context
--- |
409 |
var-env-var-strict.js |
---
es5id: 10.4.2.1_A1
description: >
Strict indirect eval should not leak top level declarations into
the global scope
--- |
463 |