@@ -33,15 +33,15 @@ contributors: Jordan Harband
33
33
1. Let _str_ be ? ToString(_S_).
34
34
1. Let _cpList_ be a List containing in order the code points as defined in 6.1.4 of _str_, starting at the first element of _str_.
35
35
1. Let _toEscape_ be a CharSet containing every character in the ASCII punctuators that need escaping.
36
- 1. Let _cuList_ be a new empty List.
36
+ 1. Let _escapedList_ be a new empty List.
37
37
1. For each code point _c_ in _cpList_, do
38
- 1. If _c_ is the first code point in _cpList_ and _c_ is a DecimalDigit, then
39
- 1. Append code unit 0x005C (REVERSE SOLIDUS) to cuList .
40
- 1. Append code unit 0x0078 (LATIN SMALL LETTER X) to cuList .
41
- 1. Else if _c_ is a CharSetElement of _toEscape_ or is WhiteSpace, then
42
- 1. Append code unit 0x005C (REVERSE SOLIDUS) to cuList .
43
- 1. Append the elements of the UTF16Encoding (10.1.1) of c to cuList .
44
- 1. Return CodePointsToString(_cuList_ ).
38
+ 1. If _escapedList_ is empty and _c_ is a | DecimalDigit| , then
39
+ 1. Append code unit U+005C (REVERSE SOLIDUS) to _escapedList_ .
40
+ 1. Append code unit U+0078 (LATIN SMALL LETTER X) to _escapedList_ .
41
+ 1. Else if _c_ is a CharSetElement of _toEscape_ or is | WhiteSpace| , then
42
+ 1. Append code unit U+005C (REVERSE SOLIDUS) to _escapedList_ .
43
+ 1. Append the elements of UTF16EncodeCodePoint(_c_) to _escapedList_ .
44
+ 1. Return CodePointsToString(_escapedList_ ).
45
45
</emu-alg>
46
46
47
47
<emu-note>
0 commit comments