You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The abstract operation GetIdentifierReference takes arguments _lex_ (an Environment Record or *null*), _name_ (a String), and _strict_ (a Boolean). It performs the following steps when called:</p>
<p>The abstract operation GetIdentifierReference takes arguments _env_ (an Environment Record or *null*), _name_ (a String), and _strict_ (a Boolean). It performs the following steps when called:</p>
7212
7212
<emu-alg>
7213
-
1. If _lex_ is the value *null*, then
7213
+
1. If _env_ is the value *null*, then
7214
7214
1. Return a value of type Reference whose base value component is *undefined*, whose referenced name component is _name_, and whose strict reference flag is _strict_.
7215
-
1. Let _exists_ be ? _lex_.HasBinding(_name_).
7215
+
1. Let _exists_ be ? _env_.HasBinding(_name_).
7216
7216
1. If _exists_ is *true*, then
7217
-
1. Return a value of type Reference whose base value component is _lex_, whose referenced name component is _name_, and whose strict reference flag is _strict_.
7217
+
1. Return a value of type Reference whose base value component is _env_, whose referenced name component is _name_, and whose strict reference flag is _strict_.
<p>The abstract operation GetThisEnvironment takes no arguments. It finds the Environment Record that currently supplies the binding of the keyword `this`. It performs the following steps when called:</p>
7563
7563
<emu-alg>
7564
-
1. Let _lex_ be the running execution context's LexicalEnvironment.
7564
+
1. Let _env_ be the running execution context's LexicalEnvironment.
7565
7565
1. Repeat,
7566
-
1. Let _exists_ be _lex_.HasThisBinding().
7567
-
1. If _exists_ is *true*, return _lex_.
7568
-
1. Let _outer_ be _lex_.[[OuterEnv]].
7566
+
1. Let _exists_ be _env_.HasThisBinding().
7567
+
1. If _exists_ is *true*, return _env_.
7568
+
1. Let _outer_ be _env_.[[OuterEnv]].
7569
7569
1. Assert: _outer_ is not *null*.
7570
-
1. Set _lex_ to _outer_.
7570
+
1. Set _env_ to _outer_.
7571
7571
</emu-alg>
7572
7572
<emu-note>
7573
7573
<p>The loop in step 2 will always terminate because the list of environments always ends with the global environment which has a `this` binding.</p>
1. If _varEnv_.HasLexicalDeclaration(_name_) is *true*, throw a *SyntaxError* exception.
24926
24926
1. NOTE: `eval` will not create a global var declaration that would be shadowed by a global lexical declaration.
24927
-
1. Let _thisLex_ be _lexEnv_.
24927
+
1. Let _thisEnv_ be _lexEnv_.
24928
24928
1. Assert: The following loop will terminate.
24929
-
1. Repeat, while _thisLex_ is not the same as _varEnv_,
24930
-
1. If _thisLex_ is not an object Environment Record, then
24929
+
1. Repeat, while _thisEnv_ is not the same as _varEnv_,
24930
+
1. If _thisEnv_ is not an object Environment Record, then
24931
24931
1. NOTE: The environment of with statements cannot contain any lexical declaration so it doesn't need to be checked for var/let hoisting conflicts.
24932
24932
1. For each _name_ in _varNames_, do
24933
-
1. If _thisLex_.HasBinding(_name_) is *true*, then
24933
+
1. If _thisEnv_.HasBinding(_name_) is *true*, then
24934
24934
1. Throw a *SyntaxError* exception.
24935
24935
1. NOTE: Annex <emu-xref href="#sec-variablestatements-in-catch-blocks"></emu-xref> defines alternate semantics for the above step.
24936
24936
1. NOTE: A direct eval will not hoist var declaration over a like-named lexical declaration.
24937
-
1. Set _thisLex_ to _thisLex_.[[OuterEnv]].
24937
+
1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]].
24938
24938
1. Let _functionsToInitialize_ be a new empty List.
24939
24939
1. Let _declaredFunctionNames_ be a new empty List.
24940
24940
1. For each _d_ in _varDeclarations_, in reverse list order, do
@@ -42955,13 +42955,13 @@ <h1>Changes to EvalDeclarationInstantiation</h1>
42955
42955
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
42956
42956
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then
42957
42957
1. Let _bindingExists_ be *false*.
42958
-
1. Let _thisLex_ be _lexEnv_.
42958
+
1. Let _thisEnv_ be _lexEnv_.
42959
42959
1. Assert: The following loop will terminate.
42960
-
1. Repeat, while _thisLex_ is not the same as _varEnv_,
42961
-
1. If _thisLex_ is not an object Environment Record, then
42962
-
1. If _thisLex_.HasBinding(_F_) is *true*, then
42960
+
1. Repeat, while _thisEnv_ is not the same as _varEnv_,
42961
+
1. If _thisEnv_ is not an object Environment Record, then
42962
+
1. If _thisEnv_.HasBinding(_F_) is *true*, then
42963
42963
1. Let _bindingExists_ be *true*.
42964
-
1. Set _thisLex_ to _thisLex_.[[OuterEnv]].
42964
+
1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]].
42965
42965
1. If _bindingExists_ is *false* and _varEnv_ is a global Environment Record, then
42966
42966
1. If _varEnv_.HasLexicalDeclaration(_F_) is *false*, then
42967
42967
1. Let _fnDefinable_ be ? _varEnv_.CanDeclareGlobalVar(_F_).
@@ -43059,11 +43059,11 @@ <h1>VariableStatements in Catch Blocks</h1>
43059
43059
<p>This modified behaviour also applies to `var` and `function` declarations introduced by direct eval calls contained within the |Block| of a |Catch| clause. This change is accomplished by modifying the algorithm of <emu-xref href="#sec-evaldeclarationinstantiation"></emu-xref> as follows:</p>
43060
43060
<p>Step 3.d.i.2.a.i is replaced by:</p>
43061
43061
<emu-alg type="i">
43062
-
1. If _thisLex_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception.
43062
+
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception.
43063
43063
</emu-alg>
43064
43064
<p>Step 7.d.ii.4.a.i.i is replaced by:</p>
43065
43065
<emu-alg type="i">
43066
-
1. If _thisLex_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*.
43066
+
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*.
0 commit comments