Skip to content

Commit 3d45b23

Browse files
authored
Editorial: Add note about leading-digit escaping
1 parent aee5a2c commit 3d45b23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spec.emu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ contributors: Jordan Harband
3030
1. Let _cpList_ be StringToCodePoints(_S_).
3131
1. For each code point _c_ in _cpList_, do
3232
1. If _escaped_ is the empty String and _c_ is matched by |DecimalDigit|, then
33+
1. NOTE: Escaping a leading digit ensures that output corresponds with pattern text which may be used after a `\0` character escape or a |DecimalEscape| such as `\1` and still match _S_ rather than be interpreted as an extension of the preceding escape sequence.
3334
1. Set _escaped_ to the string-concatenation of _escaped_, the code unit 0x005C (REVERSE SOLIDUS), *"x3"*, and the code unit whose numeric value is the numeric value of _c_.
3435
1. Else,
3536
1. Set _escaped_ to the string-concatenation of _escaped_ and EncodeForRegExpEscape(_c_).

0 commit comments

Comments
 (0)