Skip to content

Commit 06e2af4

Browse files
committed
Refactor to avoid "and" after the host-condition
1 parent 79b4b25 commit 06e2af4

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
@@ -13740,26 +13740,26 @@ <h1>
1374013740
1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*).
1374113741
1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_).
1374213742
1. NOTE: A var with the same name as a formal parameter initially has the same value as the corresponding initialized parameter.
13743-
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
13744-
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
13745-
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
13746-
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
13747-
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|.
13748-
1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then
13749-
1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*).
13750-
1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*).
13751-
1. Append _F_ to _instantiatedVarNames_.
13752-
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>:
13753-
1. Let _fenv_ be the running execution context's VariableEnvironment.
13754-
1. Let _benv_ be the running execution context's LexicalEnvironment.
13755-
1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*).
13756-
1. Perform ! _fenv_.SetMutableBinding(_F_, _fobj_, *false*).
13757-
1. Return ~unused~.
13758-
1. If _strict_ is *false*, then
13743+
1. If _strict_ is *true*, then
13744+
1. Let _lexEnv_ be _varEnv_.
13745+
1. Else,
13746+
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
13747+
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
13748+
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
13749+
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
13750+
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|.
13751+
1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then
13752+
1. Perform ! _varEnv_.CreateMutableBinding(_F_, *false*).
13753+
1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*).
13754+
1. Append _F_ to _instantiatedVarNames_.
13755+
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>:
13756+
1. Let _fenv_ be the running execution context's VariableEnvironment.
13757+
1. Let _benv_ be the running execution context's LexicalEnvironment.
13758+
1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*).
13759+
1. Perform ! _fenv_.SetMutableBinding(_F_, _fobj_, *false*).
13760+
1. Return ~unused~.
1375913761
1. Let _lexEnv_ be NewDeclarativeEnvironment(_varEnv_).
1376013762
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.
13761-
1. Else,
13762-
1. Let _lexEnv_ be _varEnv_.
1376313763
1. Set the LexicalEnvironment of _calleeContext_ to _lexEnv_.
1376413764
1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_.
1376513765
1. For each element _d_ of _lexDeclarations_, do
@@ -21120,7 +21120,7 @@ <h1>Static Semantics: Early Errors</h1>
2112021120
<emu-grammar>Block : `{` StatementList `}`</emu-grammar>
2112121121
<ul>
2112221122
<li>
21123-
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>.
21123+
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>.
2112421124
</li>
2112521125
<li>
2112621126
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -22586,7 +22586,7 @@ <h1>Static Semantics: Early Errors</h1>
2258622586
<emu-grammar>SwitchStatement : `switch` `(` Expression `)` CaseBlock</emu-grammar>
2258722587
<ul>
2258822588
<li>
22589-
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>.
22589+
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>.
2259022590
</li>
2259122591
<li>
2259222592
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -22739,7 +22739,7 @@ <h1>Static Semantics: Early Errors</h1>
2273922739
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
2274022740
<ul>
2274122741
<li>
22742-
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>.
22742+
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>.
2274322743
</li>
2274422744
</ul>
2274522745
</emu-clause>
@@ -22889,7 +22889,7 @@ <h1>Static Semantics: Early Errors</h1>
2288922889
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
2289022890
</li>
2289122891
<li>
22892-
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>.
22892+
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>.
2289322893
</li>
2289422894
</ul>
2289522895
</emu-clause>
@@ -29026,7 +29026,7 @@ <h1>
2902629026
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
2902729027
1. If _declaredVarNames_ does not contain _vn_, then
2902829028
1. Append _vn_ to _declaredVarNames_.
29029-
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
29029+
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
2903029030
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
2903129031
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
2903229032
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.

0 commit comments

Comments
 (0)