Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: replace uses of the Type macro with is-a tests #10635

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2996,7 +2996,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x="js-prod-Pattern" data-x-href="https://tc39.es/ecma262/#prod-Pattern"><i>Pattern</i></dfn> production</li>
<li>The <dfn data-x="js-prod-Script" data-x-href="https://tc39.es/ecma262/#prod-Script"><i>Script</i></dfn> production</li>

<li>The <dfn data-x="js-Type" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values">Type</dfn> notation</li>
<li>The
<dfn data-x="js-BigInt" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-language-types-bigint-type">BigInt</dfn>,
<dfn data-x="js-Boolean" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-language-types-boolean-type">Boolean</dfn>,
<dfn data-x="js-Number" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type">Number</dfn>,
<dfn data-x="js-String" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type">String</dfn>,
<dfn data-x="js-Symbol" data-x-href="https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type">Symbol</dfn>,
and <dfn data-x="js-Object" data-x-href="https://tc39.es/ecma262/#sec-object-type">Object</dfn> ECMAScript language types</li>
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-completion-record-specification-type">Completion Record</dfn> specification type</li>
<li>The <dfn data-x="js-List" data-x-href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</dfn> and
<dfn data-x-href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">Record</dfn> specification types</li>
Expand Down Expand Up @@ -9559,11 +9565,12 @@ interface <dfn interface>DOMStringList</dfn> {

<li><p>Let <var>deep</var> be false.</p></li>

<li><p>If <span data-x="js-Type">Type</span>(<var>value</var>) is Undefined, Null, Boolean,
Number, BigInt, or String, then return { [[Type]]: "primitive",
[[Value]]: <var>value</var> }.</p></li>
<li><p>If <var>value</var> is undefined, null, <span data-x="js-Boolean">a Boolean</span>, <span
data-x="js-Number">a Number</span>, <span data-x="js-BigInt">a BigInt</span>, or <span
data-x="js-String">a String</span>, then return { [[Type]]: "primitive", [[Value]]:
<var>value</var> }.</p></li>

<li><p>If <span data-x="js-Type">Type</span>(<var>value</var>) is Symbol, then throw a
<li><p>If <var>value</var> <span data-x="js-Symbol">is a Symbol</span>, then throw a
<span>"<code>DataCloneError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Let <var>serialized</var> be an uninitialized value.</p></li>
Expand Down Expand Up @@ -12063,7 +12070,7 @@ document.createElement("bad-1"); // (2)</code></pre>
"prototype").</p></li>

<li>
<p>If <span data-x="js-Type">Type</span>(<var>prototype</var>) is not Object, then:</p>
<p>If <var>prototype</var> <span data-x="js-Object">is not an Object</span>, then:</p>

<ol>
<li><p>Let <var>realm</var> be ? <span>GetFunctionRealm</span>(<span>NewTarget</span>).</p></li>
Expand Down Expand Up @@ -71120,10 +71127,10 @@ interface <dfn interface>OffscreenCanvasRenderingContext2D</dfn> {

<p>If <var>type</var> is an image format that supports variable quality (such as
"<code>image/jpeg</code>"), <var>quality</var> is given, and <var>type</var> is not
"<code>image/png</code>", then, if <span data-x="js-Type">Type</span>(<var>quality</var>) is
Number, and <var>quality</var> is in the range 0.0 to 1.0 inclusive, the user agent must treat
<var>quality</var> as the desired quality level. Otherwise, the user agent must use its default
quality value, as if the <var>quality</var> argument had not been given.</p>
"<code>image/png</code>", then, if <var>quality</var> <span data-x="js-Number">is a Number</span>
in the range 0.0 to 1.0 inclusive, the user agent must treat <var>quality</var> as the desired
quality level. Otherwise, the user agent must use its default quality value, as if the
<var>quality</var> argument had not been given.</p>

<p class="note">The use of type-testing here, instead of simply declaring <var>quality</var> as
a Web IDL <code data-x="">double</code>, is a historical artifact.</p>
Expand Down Expand Up @@ -72346,7 +72353,7 @@ dictionary <dfn dictionary>ElementDefinitionOptions</dfn> {
<li><p>Let <var>prototype</var> be ? <span data-x="js-Get">Get</span>(<var>constructor</var>,
"prototype").</p></li>

<li><p>If <span data-x="js-Type">Type</span>(<var>prototype</var>) is not Object, then throw a
<li><p>If <var>prototype</var> <span data-x="js-Object">is not an Object</span>, then throw a
<code>TypeError</code> exception.</p></li>

<li><p>Let <var>lifecycleCallbacks</var> be a map with the keys "<code
Expand Down Expand Up @@ -144774,6 +144781,7 @@ INSERT INTERFACES HERE
Michael Day,
Michael Dyck,
Michael Enright,
Michael Ficarra,
Michael Gratton,
Michael Kohler,
Michael McKelvey,
Expand Down