RESOLVED FIXED 21431
String.replace does not support $& replacement metacharacter when search term is not a RegExp
https://bugs.webkit.org/show_bug.cgi?id=21431
Summary String.replace does not support $& replacement metacharacter when search term...
Mark Rowe (bdash)
Reported 2008-10-07 10:04:12 PDT
"asdf".replace("as", "$&$&$&") gives "$&$&$&df" rather than the expected "asasasdf". "asdf".replace(/as/, "$&$&$&") correctly gives "asasasdf".
Attachments
patch (6.15 KB, patch)
2008-12-30 23:26 PST, Darin Adler
oliver: review+
Mark Rowe (bdash)
Comment 1 2008-10-07 10:08:20 PDT
Darin Adler
Comment 2 2008-12-24 23:02:02 PST
stringProtoFuncReplace needs to call substituteBackreferences on replacementString
Darin Adler
Comment 3 2008-12-30 23:26:37 PST
Darin Adler
Comment 4 2009-01-01 21:57:40 PST
Note You need to log in before you can comment on or make changes to this bug.