Skip to content

Commit 0b988b7

Browse files
jmdyckljharb
authored andcommitted
Editorial: Rename _lex_ to _env_ and _thisLex_ to _thisEnv_ (#1697)
1 parent a014888 commit 0b988b7

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

spec.html

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7207,16 +7207,16 @@ <h1>Environment Record Operations</h1>
72077207
<p>The following abstract operations are used in this specification to operate upon Environment Records:</p>
72087208

72097209
<emu-clause id="sec-getidentifierreference" aoid="GetIdentifierReference">
7210-
<h1>GetIdentifierReference ( _lex_, _name_, _strict_ )</h1>
7211-
<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>
7210+
<h1>GetIdentifierReference ( _env_, _name_, _strict_ )</h1>
7211+
<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>
72127212
<emu-alg>
7213-
1. If _lex_ is the value *null*, then
7213+
1. If _env_ is the value *null*, then
72147214
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_).
72167216
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_.
72187218
1. Else,
7219-
1. Let _outer_ be _lex_.[[OuterEnv]].
7219+
1. Let _outer_ be _env_.[[OuterEnv]].
72207220
1. Return ? GetIdentifierReference(_outer_, _name_, _strict_).
72217221
</emu-alg>
72227222
</emu-clause>
@@ -7561,13 +7561,13 @@ <h1>ResolveBinding ( _name_ [ , _env_ ] )</h1>
75617561
<h1>GetThisEnvironment ( )</h1>
75627562
<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>
75637563
<emu-alg>
7564-
1. Let _lex_ be the running execution context's LexicalEnvironment.
7564+
1. Let _env_ be the running execution context's LexicalEnvironment.
75657565
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]].
75697569
1. Assert: _outer_ is not *null*.
7570-
1. Set _lex_ to _outer_.
7570+
1. Set _env_ to _outer_.
75717571
</emu-alg>
75727572
<emu-note>
75737573
<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>
@@ -21186,8 +21186,8 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
2118621186
<p>With parameters _classBinding_ and _className_.</p>
2118721187
<emu-grammar>ClassTail : ClassHeritage? `{` ClassBody? `}`</emu-grammar>
2118821188
<emu-alg>
21189-
1. Let _lex_ be the LexicalEnvironment of the running execution context.
21190-
1. Let _classScope_ be NewDeclarativeEnvironment(_lex_).
21189+
1. Let _env_ be the LexicalEnvironment of the running execution context.
21190+
1. Let _classScope_ be NewDeclarativeEnvironment(_env_).
2119121191
1. If _classBinding_ is not *undefined*, then
2119221192
1. Perform _classScope_.CreateImmutableBinding(_classBinding_, *true*).
2119321193
1. If |ClassHeritage_opt| is not present, then
@@ -21196,7 +21196,7 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
2119621196
1. Else,
2119721197
1. Set the running execution context's LexicalEnvironment to _classScope_.
2119821198
1. Let _superclassRef_ be the result of evaluating |ClassHeritage|.
21199-
1. Set the running execution context's LexicalEnvironment to _lex_.
21199+
1. Set the running execution context's LexicalEnvironment to _env_.
2120021200
1. Let _superclass_ be ? GetValue(_superclassRef_).
2120121201
1. If _superclass_ is *null*, then
2120221202
1. Let _protoParent_ be *null*.
@@ -21234,9 +21234,9 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
2123421234
1. Else,
2123521235
1. Let _status_ be PropertyDefinitionEvaluation of _m_ with arguments _F_ and *false*.
2123621236
1. If _status_ is an abrupt completion, then
21237-
1. Set the running execution context's LexicalEnvironment to _lex_.
21237+
1. Set the running execution context's LexicalEnvironment to _env_.
2123821238
1. Return Completion(_status_).
21239-
1. Set the running execution context's LexicalEnvironment to _lex_.
21239+
1. Set the running execution context's LexicalEnvironment to _env_.
2124021240
1. If _classBinding_ is not *undefined*, then
2124121241
1. Perform _classScope_.InitializeBinding(_classBinding_, _F_).
2124221242
1. Return _F_.
@@ -24924,17 +24924,17 @@ <h1>Runtime Semantics: EvalDeclarationInstantiation ( _body_, _varEnv_, _lexEnv_
2492424924
1. For each _name_ in _varNames_, do
2492524925
1. If _varEnv_.HasLexicalDeclaration(_name_) is *true*, throw a *SyntaxError* exception.
2492624926
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_.
2492824928
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
2493124931
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.
2493224932
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
2493424934
1. Throw a *SyntaxError* exception.
2493524935
1. NOTE: Annex <emu-xref href="#sec-variablestatements-in-catch-blocks"></emu-xref> defines alternate semantics for the above step.
2493624936
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]].
2493824938
1. Let _functionsToInitialize_ be a new empty List.
2493924939
1. Let _declaredFunctionNames_ be a new empty List.
2494024940
1. For each _d_ in _varDeclarations_, in reverse list order, do
@@ -42955,13 +42955,13 @@ <h1>Changes to EvalDeclarationInstantiation</h1>
4295542955
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
4295642956
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then
4295742957
1. Let _bindingExists_ be *false*.
42958-
1. Let _thisLex_ be _lexEnv_.
42958+
1. Let _thisEnv_ be _lexEnv_.
4295942959
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
4296342963
1. Let _bindingExists_ be *true*.
42964-
1. Set _thisLex_ to _thisLex_.[[OuterEnv]].
42964+
1. Set _thisEnv_ to _thisEnv_.[[OuterEnv]].
4296542965
1. If _bindingExists_ is *false* and _varEnv_ is a global Environment Record, then
4296642966
1. If _varEnv_.HasLexicalDeclaration(_F_) is *false*, then
4296742967
1. Let _fnDefinable_ be ? _varEnv_.CanDeclareGlobalVar(_F_).
@@ -43059,11 +43059,11 @@ <h1>VariableStatements in Catch Blocks</h1>
4305943059
<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>
4306043060
<p>Step 3.d.i.2.a.i is replaced by:</p>
4306143061
<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.
4306343063
</emu-alg>
4306443064
<p>Step 7.d.ii.4.a.i.i is replaced by:</p>
4306543065
<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*.
4306743067
</emu-alg>
4306843068
</emu-annex>
4306943069

0 commit comments

Comments
 (0)