Bug 18989

Summary: sunspider regexp-dna is inaccurate on firefox
Product: WebKit Reporter: Felix <felix.1>
Component: Tools / TestsAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, barraclough, dmandelin, ggaren, mjs, oliver, sam, sayrer, sdwilsh
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Patch to update test mjs: review+

Description Felix 2008-05-10 15:57:04 PDT
dnaInput = dnaInput.replace(k, subs[k], "g")

the 3rd arg to String.replace is a js extension in firefox/spidermonkey.  it's not supported by safari/webkit, opera, and IE.  those browsers ignore the 'g' flag, so they only replace the first match.   firefox is doing a lot more work on this test than other browsers.
Comment 1 Felix 2008-05-10 15:59:10 PDT
forgot to mention.  an easy way to confirm this is to add to the end of the test
alert(dnaInput.length);
and load it on different browsers.
Comment 2 Dave Hyatt 2008-10-07 13:24:13 PDT
Created attachment 24156 [details]
Patch to update test
Comment 3 Maciej Stachowiak 2008-10-07 13:47:56 PDT
Comment on attachment 24156 [details]
Patch to update test

r=me

Can you add a FIXME above this line indicating that it should really be doing a global substitution, not just a single one? We'll want to do that in a future SunSpider version.
Comment 4 Dave Hyatt 2008-10-07 14:22:15 PDT
Fixed in r37390.