archives

« Bugzilla Issues Index

#1660 — 15.10.3.3, EscapeRegExpPattern: Line breaks and escape sequences not handled


EscapeRegExpPattern currently only handles the "/" character, but it should also handle line breaks and escape sequences.

Escape sequences are mainly of interest when escaping line breaks to avoid invalid double escapes.

Tests:

eval(RegExp("\n").toString())

-> should evaluate to a new RegExp, but throws a SyntaxError in multiple browsers


RegExp("\n").source === RegExp("\\\n").source

-> This is just an example where line breaks in escape sequences must not be double escaped


fixed in rev20 editor's draft


fixed in rev20 draft, Oct. 28, 2013