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
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
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*).
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
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*).
1. Let _lexEnv_ be NewDeclarativeEnvironment(_varEnv_).
13760
13762
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_.
13763
13763
1. Set the LexicalEnvironment of _calleeContext_ to _lexEnv_.
13764
13764
1. Let _lexDeclarations_ be the LexicallyScopedDeclarations of _code_.
13765
13765
1. For each element _d_ of _lexDeclarations_, do
@@ -21120,7 +21120,7 @@ <h1>Static Semantics: Early Errors</h1>
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>.
21124
21124
</li>
21125
21125
<li>
21126
21126
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>
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>.
22590
22590
</li>
22591
22591
<li>
22592
22592
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>
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>.
22743
22743
</li>
22744
22744
</ul>
22745
22745
</emu-clause>
@@ -22889,7 +22889,7 @@ <h1>Static Semantics: Early Errors</h1>
22889
22889
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
22890
22890
</li>
22891
22891
<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>.
22893
22893
</li>
22894
22894
</ul>
22895
22895
</emu-clause>
@@ -29026,7 +29026,7 @@ <h1>
29026
29026
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
29027
29027
1. If _declaredVarNames_ does not contain _vn_, then
29028
29028
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
29030
29030
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
29031
29031
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
29032
29032
1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
0 commit comments