Skip to content

Commit

Permalink
fixup: change wording at insertion-points; add dfn for "the host supp…
Browse files Browse the repository at this point in the history
…orts"
  • Loading branch information
jmdyck committed Feb 10, 2023
1 parent 297e096 commit 5423e29
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -4805,7 +4805,7 @@ <h1>
<emu-alg>
1. If _argument_ is a Boolean, return _argument_.
1. If _argument_ is one of *undefined*, *null*, *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *NaN*, *0*<sub>ℤ</sub>, or the empty String, return *false*.
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
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
1. If _argument_ is an Object and _argument_ has an [[IsHTMLDDA]] internal slot, return *false*.
1. Return *true*.
</emu-alg>
Expand Down Expand Up @@ -5947,7 +5947,7 @@ <h1>
1. Return IsStrictlyEqual(_x_, _y_).
1. If _x_ is *null* and _y_ is *undefined*, return *true*.
1. If _x_ is *undefined* and _y_ is *null*, return *true*.
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
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
1. If _x_ is an Object, _x_ has an [[IsHTMLDDA]] internal slot, and _y_ is either *null* or *undefined*, return *true*.
1. If _x_ is either *null* or *undefined*, _y_ is an Object, and _y_ has an [[IsHTMLDDA]] internal slot, return *true*.
1. If _x_ is a Number and _y_ is a String, return ! IsLooselyEqual(_x_, ! ToNumber(_y_)).
Expand Down Expand Up @@ -13581,7 +13581,7 @@ <h1>
1. Let _initialValue_ be ! _env_.GetBindingValue(_n_, *false*).
1. Perform ! _varEnv_.InitializeBinding(_n_, _initialValue_).
1. NOTE: A var with the same name as a formal parameter initially has the same value as the corresponding initialized parameter.
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
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
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
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
Expand Down Expand Up @@ -19619,7 +19619,7 @@ <h1>Runtime Semantics: Evaluation</h1>
1. If _val_ is a Number, return *"number"*.
1. If _val_ is a BigInt, return *"bigint"*.
1. Assert: _val_ is an Object.
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
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
1. If _val_ has an [[IsHTMLDDA]] internal slot, return *"undefined"*.
1. If _val_ has a [[Call]] internal slot, return *"function"*.
1. Return *"object"*.
Expand Down Expand Up @@ -20872,7 +20872,7 @@ <h1>Static Semantics: Early Errors</h1>
<emu-grammar>Block : `{` StatementList `}`</emu-grammar>
<ul>
<li>
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>.
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>.
</li>
<li>
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
Expand Down Expand Up @@ -20938,15 +20938,15 @@ <h1>
1. If IsConstantDeclaration of _d_ is *true*, then
1. Perform ! _env_.CreateImmutableBinding(_dn_, *true*).
1. Else,
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
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 ! _env_.HasBinding(_dn_) is *false*, then
1. Perform ! _env_.CreateMutableBinding(_dn_, *false*).
1. Else,
1. Perform ! _env_.CreateMutableBinding(_dn_, *false*).
1. If _d_ is either a |FunctionDeclaration|, a |GeneratorDeclaration|, an |AsyncFunctionDeclaration|, or an |AsyncGeneratorDeclaration|, then
1. Let _fn_ be the sole element of the BoundNames of _d_.
1. Let _fo_ be InstantiateFunctionObject of _d_ with arguments _env_ and _privateEnv_.
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
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
1. If the binding for _fn_ in _env_ is an uninitialized binding, then
1. Perform ! _env_.InitializeBinding(_fn_, _fo_).
1. Else,
Expand Down Expand Up @@ -22344,7 +22344,7 @@ <h1>Static Semantics: Early Errors</h1>
<emu-grammar>SwitchStatement : `switch` `(` Expression `)` CaseBlock</emu-grammar>
<ul>
<li>
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>.
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>.
</li>
<li>
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
Expand Down Expand Up @@ -22497,7 +22497,7 @@ <h1>Static Semantics: Early Errors</h1>
<emu-grammar>LabelledItem : FunctionDeclaration</emu-grammar>
<ul>
<li>
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>.
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>.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -22647,7 +22647,7 @@ <h1>Static Semantics: Early Errors</h1>
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
</li>
<li>
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>.
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>.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -25699,7 +25699,7 @@ <h1>
1. If _declaredVarNames_ does not contain _vn_, then
1. Append _vn_ to _declaredVarNames_.
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.
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
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
1. Let _strict_ be IsStrict of _script_.
1. If _strict_ is *false*, then
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
Expand Down Expand Up @@ -28731,7 +28731,7 @@ <h1>
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.
1. For each element _name_ of _varNames_, do
1. If ! _thisEnv_.HasBinding(_name_) is *true*, then
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
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
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, throw a *SyntaxError* exception.
1. Else,
1. Throw a *SyntaxError* exception.
Expand Down Expand Up @@ -28767,7 +28767,7 @@ <h1>
1. If _vnDefinable_ is *false*, throw a *TypeError* exception.
1. If _declaredVarNames_ does not contain _vn_, then
1. Append _vn_ to _declaredVarNames_.
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
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
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
Expand All @@ -28778,7 +28778,7 @@ <h1>
1. Repeat, while _thisEnv_ is not _varEnv_,
1. If _thisEnv_ is not an Object Environment Record, then
1. If ! _thisEnv_.HasBinding(_F_) is *true*, then
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
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
1. If _thisEnv_ is not the Environment Record for a |Catch| clause, let _bindingExists_ be *true*.
1. Else,
1. Let _bindingExists_ be *true*.
Expand Down Expand Up @@ -47409,6 +47409,8 @@ <h1>Regular Expressions</h1>
<emu-annex id="sec-additional-ecmascript-features-for-web-browsers" namespace="annexB" normative>
<h1>Additional ECMAScript Features for Web Browsers</h1>
<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>
<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>
<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>
<emu-note>
<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>
<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>
Expand Down

0 comments on commit 5423e29

Please sign in to comment.