WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 9234
7919
JavaScript String.prototype.replace does not respect "$&" replacements
https://bugs.webkit.org/show_bug.cgi?id=7919
Summary
JavaScript String.prototype.replace does not respect "$&" replacements
Udo Borkowski
Reported
2006-03-22 13:34:36 PST
The JavaScript implementation for String.prototype.replace does not respect the "$&" replacement. This sequence should be replaced with the matched text. E.g.: "and more ...".replace(/\./g, "$&") wrongly evaluates to "and more $&$&$&" Correct value would be: "and more ..." (For details see "15.5.4.11 String.prototype.replace (searchValue, replaceValue)" in "ECMA-262: ECMAScript specification", page 102 (
http://www.ecma-international.org/publications/standards/Ecma-262.htm
)) Please also verify if the other "$" replacements documented there are supported. (I used Safari 2.0.3)
Attachments
Description, further extension, and testcases for bug #7919
(2.64 KB, text/html)
2006-05-16 02:31 PDT
,
Adam Bergmark
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2006-03-22 15:04:42 PST
Confirmed with WebKit 417.9.2 and SVN
r13434
.
Adam Bergmark
Comment 2
2006-05-16 02:31:57 PDT
Created
attachment 8348
[details]
Description, further extension, and testcases for
bug #7919
Open the HTML file in your browser, click the buttons to run the test cases.
mitz
Comment 3
2006-12-19 10:10:43 PST
*** This bug has been marked as a duplicate of
9234
***
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