Bug 44067

Summary: Single-character replace does not substitute metachars
Product: WebKit Reporter: Chris Leary <christopher.leary>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, ggaren, msaboff, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: https://bugzilla.mozilla.org/show_bug.cgi?id=587366
Attachments:
Description Flags
Patch to fix single character search string optimization. none

Description Chris Leary 2010-08-16 12:35:23 PDT
Steps to reproduce:

Command:  jsc -e 'print(")".replace(")", "*$&*"))'
Actual:   *$&*
Expected: *)*

References: ECMAv5:15.5.4.11
Comment 1 Michael Saboff 2010-08-19 17:16:50 PDT
Created attachment 64914 [details]
Patch to fix single character search string optimization.

Added check to only execute single character replace() optimization if there aren't any back references by checking for existence of '$' in replace string.
Comment 2 WebKit Commit Bot 2010-08-23 16:13:34 PDT
Comment on attachment 64914 [details]
Patch to fix single character search string optimization.

Clearing flags on attachment: 64914

Committed r65840: <http://trac.webkit.org/changeset/65840>
Comment 3 WebKit Commit Bot 2010-08-23 16:13:38 PDT
All reviewed patches have been landed.  Closing bug.