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
This will make IDL adopt https://infra.spec.whatwg.org/#javascript-string-convert rather than have its own algorithm ("obtain Unicode" also known as "convert to a sequence of Unicode scalar values" also known as "convert a DOMString to a sequence of Unicode scalar values").
Copy file name to clipboardExpand all lines: index.bs
+2-39Lines changed: 2 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -6060,43 +6060,6 @@ of specifications using Web IDL might want to obtain a sequence of
6060
6060
[=Unicode scalar values=] given a particular sequence of
6061
6061
[=code units=].
6062
6062
6063
-
<div algorithm>
6064
-
6065
-
The following algorithm defines a way to
6066
-
<dfn id="dfn-obtain-unicode" export lt="obtain Unicode|convert to a sequence of Unicode scalar values">convert a DOMString to a sequence of Unicode scalar values</dfn>:
6067
-
6068
-
1. Let |S| be the {{DOMString}} value.
6069
-
1. Let |n| be the length of |S|.
6070
-
1. Initialize |i| to 0.
6071
-
1. Initialize |U| to be an empty sequence of Unicode characters.
6072
-
1. While |i| < |n|:
6073
-
1. Let |c| be the [=code unit=] in |S| at index |i|.
6074
-
1. Depending on the value of |c|:
6075
-
<dl class="switch">
6076
-
: |c| < 0xD800 or |c| > 0xDFFF
6077
-
:: Append to |U| the Unicode character with code point |c|.
6078
-
: 0xDC00 ≤ |c| ≤ 0xDFFF
6079
-
:: Append to |U| a <span class="char">U+FFFD REPLACEMENT CHARACTER</span>.
6080
-
: 0xD800 ≤ |c| ≤ 0xDBFF
6081
-
:: <ol class="only">
6082
-
1. If |i| = |n|−1, then append to |U| a <span class="char">U+FFFD REPLACEMENT CHARACTER</span>.
6083
-
1. Otherwise, |i| < |n|−1:
6084
-
1. Let |d| be the code unit in |S| at index
6085
-
|i|+1.
6086
-
1. If 0xDC00 ≤ |d| ≤ 0xDFFF, then:
6087
-
1. Let |a| be |c| & 0x3FF.
6088
-
1. Let |b| be |d| & 0x3FF.
6089
-
1. Append to |U| the Unicode character with
6090
-
code point 2<sup>16</sup>+2<sup>10</sup>|a|+|b|.
6091
-
1. Set |i| to |i|+1.
6092
-
1. Otherwise, |d| < 0xDC00 or |d| > 0xDFFF.
6093
-
Append to |U| a <span class="char">U+FFFD REPLACEMENT CHARACTER</span>.
6094
-
</ol>
6095
-
</dl>
6096
-
1. Set |i| to |i|+1.
6097
-
1. Return |U|.
6098
-
</div>
6099
-
6100
6063
There is no way to represent a constant {{DOMString}}
6101
6064
value in IDL, although {{DOMString}} [=dictionary member=] [=dictionary member/default values=]
6102
6065
and [=optional argument|operation optional argument=] [=optional argument/default values=]
@@ -7674,7 +7637,7 @@ value when its bit pattern is interpreted as an unsigned 64 bit integer.
7674
7637
1. Let |string| be the result of [=converted to an IDL value|converting=] |V|
7675
7638
to a {{DOMString}}.
7676
7639
1. Return an IDL {{USVString}} value that is the result of
7677
-
[=obtain Unicode|converting=] |string| to a sequence of [=Unicode scalar values=].
7640
+
[=string/convert|converting=] |string| to a sequence of [=Unicode scalar values=].
7678
7641
</div>
7679
7642
7680
7643
<div id="USVString-to-es" algorithm="convert an USVString to an ECMAScript value">
@@ -14286,7 +14249,7 @@ Note: as discussed in [[#es-DOMException-specialness]], the ECMAScript binding i
14286
14249
requirements beyond the normal ones for [=interface types=].
14287
14250
14288
14251
Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn> and
14289
-
<dfn for="DOMException">message</dfn>, both [=JavaScript strings=].
14252
+
<dfn for="DOMException">message</dfn>, both [=strings=].
14290
14253
14291
14254
The <dfn constructor for="DOMException"><code>DOMException(|message|, |name|)</code></dfn>
0 commit comments