Skip to content

Commit 5423e29

Browse files
committed
fixup: change wording at insertion-points; add dfn for "the host supports"
1 parent 297e096 commit 5423e29

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

spec.html

+16-14
Original file line numberDiff line numberDiff line change
@@ -4805,7 +4805,7 @@ <h1>
48054805
<emu-alg>
48064806
1. If _argument_ is a Boolean, return _argument_.
48074807
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
48094809
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
48104810
1. Return *true*.
48114811
</emu-alg>
@@ -5947,7 +5947,7 @@ <h1>
59475947
1. Return IsStrictlyEqual(_x_, _y_).
59485948
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
59495949
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
59515951
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
59525952
1. If _x_ is either *null* or *undefined*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
59535953
1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)).
@@ -13581,7 +13581,7 @@ <h1>
1358113581
1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*).
1358213582
1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_).
1358313583
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
1358513585
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
1358613586
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
1358713587
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
@@ -19619,7 +19619,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1961919619
1. If _val_ is a Number, return *"number"*.
1962019620
1. If _val_ is a BigInt, return *"bigint"*.
1962119621
1. Assert: _val_ is an Object.
19622-
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
1962319623
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
1962419624
1. If _val_ has a [[Call]] internal slot, return *"function"*.
1962519625
1. Return *"object"*.
@@ -20872,7 +20872,7 @@ <h1>Static Semantics: Early Errors</h1>
2087220872
<emu-grammar>Block : `{` StatementList `}`</emu-grammar>
2087320873
<ul>
2087420874
<li>
20875-
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>.
2087620876
</li>
2087720877
<li>
2087820878
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>
2093820938
1. If IsConstantDeclaration of _d_ is *true*, then
2093920939
1. Perform ! _env_.CreateImmutableBinding(_dn_, *true*).
2094020940
1. Else,
20941-
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
2094220942
1. If ! _env_.HasBinding(_dn_) is *false*, then
2094320943
1. Perform ! _env_.CreateMutableBinding(_dn_, *false*).
2094420944
1. Else,
2094520945
1. Perform ! _env_.CreateMutableBinding(_dn_, *false*).
2094620946
1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then
2094720947
1. Let _fn_ be the sole element of the BoundNames of _d_.
2094820948
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
2095020950
1. If the binding for _fn_ in _env_ is an uninitialized binding, then
2095120951
1. Perform ! _env_.InitializeBinding(_fn_, _fo_).
2095220952
1. Else,
@@ -22344,7 +22344,7 @@ <h1>Static Semantics: Early Errors</h1>
2234422344
<emu-grammar>SwitchStatement : `switch` `(` Expression `)` CaseBlock</emu-grammar>
2234522345
<ul>
2234622346
<li>
22347-
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>.
2234822348
</li>
2234922349
<li>
2235022350
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>
2249722497
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
2249822498
<ul>
2249922499
<li>
22500-
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>.
2250122501
</li>
2250222502
</ul>
2250322503
</emu-clause>
@@ -22647,7 +22647,7 @@ <h1>Static Semantics: Early Errors</h1>
2264722647
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
2264822648
</li>
2264922649
<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>.
2265122651
</li>
2265222652
</ul>
2265322653
</emu-clause>
@@ -25699,7 +25699,7 @@ <h1>
2569925699
1. If _declaredVarNames_ does not contain _vn_, then
2570025700
1. Append _vn_ to _declaredVarNames_.
2570125701
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
2570325703
1. Let _strict_ be IsStrict of _script_.
2570425704
1. If _strict_ is *false*, then
2570525705
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
@@ -28731,7 +28731,7 @@ <h1>
2873128731
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.
2873228732
1. For each element _name_ of _varNames_, do
2873328733
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
2873528735
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception.
2873628736
1. Else,
2873728737
1. Throw a *SyntaxError* exception.
@@ -28767,7 +28767,7 @@ <h1>
2876728767
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
2876828768
1. If _declaredVarNames_ does not contain _vn_, then
2876928769
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
2877128771
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
2877228772
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
2877328773
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
@@ -28778,7 +28778,7 @@ <h1>
2877828778
1. Repeat, while _thisEnv_ is not _varEnv_,
2877928779
1. If _thisEnv_ is not an Object Environment Record, then
2878028780
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
2878228782
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*.
2878328783
1. Else,
2878428784
1. Let _bindingExists_ be *true*.
@@ -47409,6 +47409,8 @@ <h1>Regular Expressions</h1>
4740947409
<emu-annex id="sec-additional-ecmascript-features-for-web-browsers" namespace="annexB" normative>
4741047410
<h1>Additional ECMAScript Features for Web Browsers</h1>
4741147411
<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>
4741247414
<emu-note>
4741347415
<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>
4741447416
<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

Comments
 (0)