Bug 44067 - Single-character replace does not substitute metachars
Summary: Single-character replace does not substitute metachars
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL: https://bugzilla.mozilla.org/show_bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 12:35 PDT by Chris Leary
Modified: 2010-08-23 16:13 PDT (History)
5 users (show)

See Also:


Attachments
Patch to fix single character search string optimization. (1.68 KB, patch)
2010-08-19 17:16 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.