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
{{ message }}
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
<dd>If the code unit represents a RegExp punctuator that needs escaping, or ASCII whitespace, it produces the code units for *"\x"* followed by the relevant escape code. If the code unit represents non-ASCII white space, it produces the code units for *"\u"* followed by the relevant escape code. Otherwise, it returns a List containing the original code unit.</dd>
56
56
</dl>
57
57
58
58
<emu-alg>
59
-
1. Let _codeUnits_ be a new empty List.
59
+
1. Let _codePoints_ be a new empty List.
60
60
1. Let _punctuators_ be the following String, which consists of every ASCII punctuator except U+005F (LOW LINE): *"(){}[]|,.?\*+-^$=<>\/#&!%:;@~'"`"*.
61
61
1. Let _toEscape_ be StringToCodePoints(_punctuators_).
62
62
1. If _toEscape_ contains _c_ or _c_ is matched by |WhiteSpace|, then
63
-
1. Append code unit U+005C (REVERSE SOLIDUS) to _codeUnits_.
63
+
1. Append code point U+005C (REVERSE SOLIDUS) to _codePoints_.
64
64
1. Let _hex_ be Number::toString(𝔽(_c_), 16).
65
65
1. If the length of _hex_ is 1 or 2, then
66
66
1. Set _hex_ to StringPad(_hex_, 2, *"0"*, ~start~).
67
-
1. Append code unit U+0078 (LATIN SMALL LETTER X) to _codeUnits_.
67
+
1. Append code point U+0078 (LATIN SMALL LETTER X) to _codePoints_.
68
+
1. Append the code points in StringToCodePoints(_hex_) to _codePoints_.
69
+
1. Else if the length of _hex_ is > 4, then
70
+
1. Append code point U+0075 (LATIN SMALL LETTER U) to _codePoints_.
71
+
1. Append code point U+007B (LEFT CURLY BRACKET) to _codePoints_.
72
+
1. Append the code points in StringToCodePoints(_hex_) to _codePoints_.
73
+
1. Append code point U+007D (RIGHT CURLY BRACKET) to _codePoints_.
68
74
1. Else,
69
75
1. Assert: The length of _hex_ is at most 4.
70
76
1. Set _hex_ to StringPad(_hex_, 4, *"0"*, ~start~).
71
-
1. Append code unit U+0075 (LATIN SMALL LETTER U) to _codeUnits_.
72
-
1. Append the code units in _hex_ to _codeUnits_.
77
+
1. Append code point U+0075 (LATIN SMALL LETTER U) to _codePoints_.
78
+
1. Append the code points in StringToCodePoints(_hex_) to _codePoints_.
0 commit comments