« Bugzilla Issues Index

#1660 —, 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.



-> 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