Skip to content

Commit a96ab88

Browse files
committed
Refactor to avoid "and" after the host-condition
1 parent a0f2735 commit a96ab88

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

spec.html

+23-23
Original file line numberDiff line numberDiff line change
@@ -13783,26 +13783,26 @@ <h1>
1378313783
1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*).
1378413784
1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_).
1378513785
1. NOTE: A var with the same name as a formal parameter initially has the same value as the corresponding initialized parameter.
13786-
1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref> and _strict_ is *false*, then
13787-
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _code_ Contains _x_ is *true*, do
13788-
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
13789-
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _parameterNames_ does not contain _F_, then
13790-
1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|.
13791-
1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then
13792-
1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*).
13793-
1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*).
13794-
1. Append _F_ to _instantiatedVarNames_.
13795-
1. [id="step-functiondeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in <emu-xref href="#sec-function-definitions-runtime-semantics-evaluation"></emu-xref>:
13796-
1. Let _fEnv_ be the running execution context's VariableEnvironment.
13797-
1. Let _bEnv_ be the running execution context's LexicalEnvironment.
13798-
1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*).
13799-
1. Perform ! _fEnv_.SetMutableBinding(_F_, _fObj_, *false*).
13800-
1. Return ~unused~.
13801-
1. If _strict_ is *false*, then
13786+
1. If _strict_ is *true*, then
13787+
1. Let _lexEnv_ be _varEnv_.
13788+
1. Else,
13789+
1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, then
13790+
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _code_ Contains _x_ is *true*, do
13791+
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
13792+
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _parameterNames_ does not contain _F_, then
13793+
1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|.
13794+
1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then
13795+
1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*).
13796+
1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*).
13797+
1. Append _F_ to _instantiatedVarNames_.
13798+
1. [id="step-functiondeclarationinstantiation-alt-funcdecl-eval"] When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in <emu-xref href="#sec-function-definitions-runtime-semantics-evaluation"></emu-xref>:
13799+
1. Let _fEnv_ be the running execution context's VariableEnvironment.
13800+
1. Let _bEnv_ be the running execution context's LexicalEnvironment.
13801+
1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*).
13802+
1. Perform ! _fEnv_.SetMutableBinding(_F_, _fObj_, *false*).
13803+
1. Return ~unused~.
1380213804
1. Let _lexEnv_ be NewDeclarativeEnvironment(_varEnv_).
1380313805
1. NOTE: Non-strict functions use a separate Environment Record for top-level lexical declarations so that a direct eval can determine whether any var scoped declarations introduced by the eval code conflict with pre-existing top-level lexically scoped declarations. This is not needed for strict functions because a strict direct eval always places all declarations into a new Environment Record.
13804-
1. Else,
13805-
1. Let _lexEnv_ be _varEnv_.
1380613806
1. Set the LexicalEnvironment of _calleeContext_ to _lexEnv_.
1380713807
1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_.
1380813808
1. For each element _d_ of _lexDeclarations_, do
@@ -21185,7 +21185,7 @@ <h1>Static Semantics: Early Errors</h1>
2118521185
<emu-grammar>Block : `{` StatementList `}`</emu-grammar>
2118621186
<ul>
2118721187
<li>
21188-
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<span normative-optional>, unless the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, IsStrict(this production) is *false*, and the duplicate entries are only bound by FunctionDeclarations</span>.
21188+
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<span normative-optional>, unless IsStrict(this production) is *false*, the duplicate entries are only bound by FunctionDeclarations, and the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></span>.
2118921189
</li>
2119021190
<li>
2119121191
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -22653,7 +22653,7 @@ <h1>Static Semantics: Early Errors</h1>
2265322653
<emu-grammar>SwitchStatement : `switch` `(` Expression `)` CaseBlock</emu-grammar>
2265422654
<ul>
2265522655
<li>
22656-
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<span normative-optional>, unless the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, IsStrict(this production) is *false*, and the duplicate entries are only bound by FunctionDeclarations</span>.
22656+
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<span normative-optional>, unless IsStrict(this production) is *false*, the duplicate entries are only bound by FunctionDeclarations, and the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></span>.
2265722657
</li>
2265822658
<li>
2265922659
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -22806,7 +22806,7 @@ <h1>Static Semantics: Early Errors</h1>
2280622806
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
2280722807
<ul>
2280822808
<li>
22809-
It is a Syntax Error if any source text is matched by this production<span normative-optional>, unless the host is a web browser or otherwise supports <emu-xref href="#sec-labelled-function-declarations" title></emu-xref> and that source text is non-strict code</span>.
22809+
It is a Syntax Error if any source text is matched by this production<span normative-optional>, unless that source text is non-strict code and the host is a web browser or otherwise supports <emu-xref href="#sec-labelled-function-declarations" title></emu-xref></span>.
2281022810
</li>
2281122811
</ul>
2281222812
</emu-clause>
@@ -22956,7 +22956,7 @@ <h1>Static Semantics: Early Errors</h1>
2295622956
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
2295722957
</li>
2295822958
<li>
22959-
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|<span normative-optional>, unless the host is a web browser or otherwise supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref> and |CatchParameter| is <emu-grammar>CatchParameter : BindingIdentifier</emu-grammar></span>.
22959+
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|<span normative-optional>, unless |CatchParameter| is <emu-grammar>CatchParameter : BindingIdentifier</emu-grammar> and the host is a web browser or otherwise supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref></span>.
2296022960
</li>
2296122961
</ul>
2296222962
</emu-clause>
@@ -29191,7 +29191,7 @@ <h1>
2919129191
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
2919229192
1. If _declaredVarNames_ does not contain _vn_, then
2919329193
1. Append _vn_ to _declaredVarNames_.
29194-
1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point", normative-optional] If the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref> and _strict_ is *false*, then
29194+
1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point", normative-optional] If _strict_ is *false* and the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, then
2919529195
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
2919629196
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of any |Block|, |CaseClause|, or |DefaultClause| _x_ such that _body_ Contains _x_ is *true*, do
2919729197
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.

0 commit comments

Comments
 (0)