ECMA-262 5.1 subsections 10.4.2 and 10.4.2.1 refer to a "calling context." This doesn't appear to be described anywhere else in the document.
Quoting the spec, emphasis mine:
10.4.2 Entering Eval Code
The following steps are performed when control enters the execution context for eval code:
- If there is no calling context or if the eval code is not being evaluated by a direct call (15.1.2.1.1) to the eval function then,
10.4.2.1 Strict Mode Restrictions
The eval code cannot instantiate variable or function bindings in the variable environment of the calling context that invoked the eval if either the code of the calling context or the eval code is strict code. Instead such bindings are instantiated in a new VariableEnvironment that is only accessible to the eval code.
What does "calling context" mean in these paragraphs? I would assume it refers to the Execution Context at the top of the stack just before
eval
is called; can anyone verify this?What does it mean to have "no calling context?" Can someone provide an example of code or conditions that could result in a call to
eval
with no calling context?