Bug 23409

Summary: REGRESSION: RegExp 'replace()' function improperly processes '$$'
Product: WebKit Reporter: William J. Edney <bedney>
Component: JavaScriptCoreAssignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: darin
Priority: P2 Keywords: EasyFix, HasReduction, InRadar, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
A testcase demonstrating how '$$' is broken.
none
patch sam: review+

William J. Edney
Reported 2009-01-17 17:28:19 PST
All - I've attached a testcase that shows that Webkit's JS engine is no longer properly processing '$$' when present in a replace() using a RegExp, where the replacement is a String (in Safari 3.2.X, this is working fine). Within the replacement String, '$' is used as a metacharacter along with a number or other special character to reference part of a match. Therefore, to output a '$', you need to use '$$'. This should output a single '$'. But in the latest Webkit builds (I'm using r40000), a '$$' is output when this syntax is used. All other browsers, FF 3.0.X, IE7+, Chrome properly process this (as does Safari as mentioned above). I've attached a small testcase. Cheers, - Bill
Attachments
A testcase demonstrating how '$$' is broken. (546 bytes, text/html)
2009-01-17 17:29 PST, William J. Edney
no flags
patch (5.34 KB, patch)
2009-01-19 12:54 PST, Darin Adler
sam: review+
William J. Edney
Comment 1 2009-01-17 17:29:33 PST
Created attachment 26830 [details] A testcase demonstrating how '$$' is broken.
Mark Rowe (bdash)
Comment 2 2009-01-18 15:46:30 PST
Darin Adler
Comment 3 2009-01-19 12:54:58 PST
Darin Adler
Comment 4 2009-01-19 15:35:08 PST
William J. Edney
Comment 5 2009-01-23 13:53:40 PST
Verified fixed in build 40102. Thanks guys! Cheers, - Bill
Note You need to log in before you can comment on or make changes to this bug.