Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit cf7270b

Browse files
committed
[spec] review from #60
1 parent c78047f commit cf7270b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spec.emu

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ contributors: Jordan Harband
3333
1. Let _str_ be ? ToString(_S_).
3434
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_.
3535
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.
3737
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_).
4545
</emu-alg>
4646

4747
<emu-note>

0 commit comments

Comments
 (0)