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
Copy file name to clipboardexpand all lines: spec.html
+16-14
Original file line number
Diff line number
Diff line change
@@ -4805,7 +4805,7 @@ <h1>
4805
4805
<emu-alg>
4806
4806
1. If _argument_ is a Boolean, return _argument_.
4807
4807
1. If _argument_ is one of *undefined*, *null*, *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *NaN*, *0*<sub>ℤ</sub>, or the empty String, return *false*.
4808
-
1. [id="step-to-boolean-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
4808
+
1. [id="step-to-boolean-web-compat-insertion-point"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
4809
4809
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
4810
4810
1. Return *true*.
4811
4811
</emu-alg>
@@ -5947,7 +5947,7 @@ <h1>
5947
5947
1. Return IsStrictlyEqual(_x_, _y_).
5948
5948
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
5949
5949
1. If _x_ is *undefined* and _y_ is *null*, return *true*.
5950
-
1. [id="step-abstract-equality-comparison-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
5950
+
1. [id="step-abstract-equality-comparison-web-compat-insertion-point"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
5951
5951
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
5952
5952
1. If _x_ is either *null* or *undefined*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
5953
5953
1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)).
@@ -13581,7 +13581,7 @@ <h1>
13581
13581
1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*).
1. NOTE: A var with the same name as a formal parameter initially has the same value as the corresponding initialized parameter.
13584
-
1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref> and _strict_ is *false*</ins>, then
13584
+
1. [id="step-functiondeclarationinstantiation-web-compat-insertion-point"] If <ins annex-b>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*</ins>, then
13585
13585
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
13586
13586
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
13587
13587
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
1. [id="step-typeof-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
19622
+
1. [id="step-typeof-web-compat-insertion-point"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-IsHTMLDDA-internal-slot" title></emu-xref></ins>, then
19623
19623
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
19624
19624
1. If _val_ has a [[Call]] internal slot, return *"function"*.
19625
19625
1. Return *"object"*.
@@ -20872,7 +20872,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins normative-optional>, unless the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, the source text matched by this production is not strict mode code, and the duplicate entries are only bound by FunctionDeclarations</ins>.
20875
+
It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries<ins annex-b>, 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>, the source text matched by this production is not strict mode code, and the duplicate entries are only bound by FunctionDeclarations</ins>.
20876
20876
</li>
20877
20877
<li>
20878
20878
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -20938,15 +20938,15 @@ <h1>
20938
20938
1. If IsConstantDeclaration of _d_ is *true*, then
1. [id="step-blockdeclarationinstantiation-createmutablebinding"] If <ins normative-optional>the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
20941
+
1. [id="step-blockdeclarationinstantiation-createmutablebinding"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then
20947
20947
1. Let _fn_ be the sole element of the BoundNames of _d_.
20948
20948
1. Let _fo_ be InstantiateFunctionObject of _d_ with arguments _env_ and _privateEnv_.
20949
-
1. [id="step-blockdeclarationinstantiation-initializebinding"] If <ins normative-optional>the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
20949
+
1. [id="step-blockdeclarationinstantiation-initializebinding"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
20950
20950
1. If the binding for _fn_ in _env_ is an uninitialized binding, then
20951
20951
1. Perform ! _env_.InitializeBinding(_fn_, _fo_).
20952
20952
1. Else,
@@ -22344,7 +22344,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins normative-optional>, unless the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref>, the source text matched by this production is not strict mode code, and the duplicate entries are only bound by FunctionDeclarations</ins>.
22347
+
It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries<ins annex-b>, 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>, the source text matched by this production is not strict mode code, and the duplicate entries are only bound by FunctionDeclarations</ins>.
22348
22348
</li>
22349
22349
<li>
22350
22350
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -22497,7 +22497,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if any source text is matched by this production<ins normative-optional>, unless the host supports <emu-xref href="#sec-labelled-function-declarations" title></emu-xref> and that source text is non-strict code</ins>.
22500
+
It is a Syntax Error if any source text is matched by this production<ins annex-b>, 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</ins>.
22501
22501
</li>
22502
22502
</ul>
22503
22503
</emu-clause>
@@ -22647,7 +22647,7 @@ <h1>Static Semantics: Early Errors</h1>
22647
22647
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
22648
22648
</li>
22649
22649
<li>
22650
-
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|<ins normative-optional>, unless the host supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref> and |CatchParameter| is <emu-grammar>CatchParameter : BindingIdentifier</emu-grammar></ins>.
22650
+
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the VarDeclaredNames of |Block|<ins annex-b>, 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></ins>.
22651
22651
</li>
22652
22652
</ul>
22653
22653
</emu-clause>
@@ -25699,7 +25699,7 @@ <h1>
25699
25699
1. If _declaredVarNames_ does not contain _vn_, then
25700
25700
1. Append _vn_ to _declaredVarNames_.
25701
25701
1. NOTE: No abnormal terminations occur after this algorithm step if the global object is an ordinary object. However, if the global object is a Proxy exotic object it may exhibit behaviours that cause abnormal terminations in some of the following steps.
25702
-
1. [id="step-globaldeclarationinstantiation-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
25702
+
1. [id="step-globaldeclarationinstantiation-web-compat-insertion-point"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref></ins>, then
25703
25703
1. Let _strict_ be IsStrict of _script_.
25704
25704
1. If _strict_ is *false*, then
25705
25705
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
@@ -28731,7 +28731,7 @@ <h1>
28731
28731
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.
28732
28732
1. For each element _name_ of _varNames_, do
28733
28733
1. If ! _thisEnv_.HasBinding(_name_) is *true*, then
28734
-
1. [id="step-evaldeclarationinstantiation-throw-duplicate-binding"] If <ins normative-optional>the host supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref></ins>, then
28734
+
1. [id="step-evaldeclarationinstantiation-throw-duplicate-binding"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref></ins>, then
28735
28735
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception.
28736
28736
1. Else,
28737
28737
1. Throw a *SyntaxError* exception.
@@ -28767,7 +28767,7 @@ <h1>
28767
28767
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
28768
28768
1. If _declaredVarNames_ does not contain _vn_, then
28769
28769
1. Append _vn_ to _declaredVarNames_.
28770
-
1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point"] If <ins normative-optional>the host supports <emu-xref href="#sec-block-level-function-declarations-web-legacy-compatibility-semantics" title></emu-xref> and _strict_ is *false*</ins>, then
28770
+
1. [id="step-evaldeclarationinstantiation-web-compat-insertion-point"] If <ins annex-b>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*</ins>, then
28771
28771
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
28772
28772
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
28773
28773
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
@@ -28778,7 +28778,7 @@ <h1>
28778
28778
1. Repeat, while _thisEnv_ is not _varEnv_,
28779
28779
1. If _thisEnv_ is not an Object Environment Record, then
28780
28780
1. If ! _thisEnv_.HasBinding(_F_) is *true*, then
28781
-
1. [id="step-evaldeclarationinstantiation-web-compat-bindingexists"] If <ins normative-optional>the host supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref></ins>, then
28781
+
1. [id="step-evaldeclarationinstantiation-web-compat-bindingexists"] If <ins annex-b>the host is a web browser or otherwise supports <emu-xref href="#sec-variablestatements-in-catch-blocks" title></emu-xref></ins>, then
28782
28782
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*.
<h1>Additional ECMAScript Features for Web Browsers</h1>
47411
47411
<p>The ECMAScript language syntax and semantics defined in this annex are required when the ECMAScript host is a web browser. The content of this annex is normative but optional if the ECMAScript host is not a web browser.</p>
47412
+
<p>Each of the features defined in this annex is specified as a set of modifications to the syntax, semantics, and/or built-in properties specified in the main body of this document. In some cases, those modifications appear in this annex, and in others, they appear (specially marked) in the main body.</p>
47413
+
<p>When a modification to semantics appears in the main body (in an algorithm or early error rule), it is guarded by the condition that “<dfn variants="otherwise supports">the host supports</dfn>” the relevant feature. Web browsers are required to support all such features.</p>
47412
47414
<emu-note>
47413
47415
<p>This annex describes various legacy features and other characteristics of web browser ECMAScript hosts. All of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification. However, the usage of these features by large numbers of existing web pages means that web browsers must continue to support them. The specifications in this annex define the requirements for interoperable implementations of these legacy features.</p>
47414
47416
<p>These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these features and behaviours when writing new ECMAScript code. ECMAScript implementations are discouraged from implementing these features unless the implementation is part of a web browser or is required to run the same legacy ECMAScript code that web browsers encounter.</p>
0 commit comments