WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2008-10-07 10:08:20 PDT
<
rdar://problem/6274993
>
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
Created
attachment 26331
[details]
patch
Darin Adler
Comment 4
2009-01-01 21:57:40 PST
http://trac.webkit.org/changeset/39542
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug