RESOLVED FIXED Bug 170151
String.prototype.replace incorrectly applies "special replacement parameters" when passed a function
https://bugs.webkit.org/show_bug.cgi?id=170151
Summary String.prototype.replace incorrectly applies "special replacement parameters"...
twalpole
Reported 2017-03-27 17:45:24 PDT
When String.prototype.replace is passed a function as a second parameter it is incorrectly applying "special replacement patterns" to the returned results var a="ABC"; a.replace("B", function(){ return "$$" }); // Should be "A$$C" - in Safari 10.1 and 10.2 it is "A$C"
Attachments
Patch (9.07 KB, patch)
2017-03-30 09:36 PDT, GSkachkov
no flags
Archive of layout-test-results from ews107 for mac-elcapitan-wk2 (1.03 MB, application/zip)
2017-03-30 14:29 PDT, Build Bot
no flags
Archive of layout-test-results from ews112 for mac-elcapitan (2.06 MB, application/zip)
2017-03-30 14:40 PDT, Build Bot
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (917.94 KB, application/zip)
2017-03-30 14:43 PDT, Build Bot
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (14.21 MB, application/zip)
2017-03-30 15:08 PDT, Build Bot
no flags
Patch (9.14 KB, patch)
2017-03-31 00:59 PDT, GSkachkov
no flags
Radar WebKit Bug Importer
Comment 1 2017-03-28 23:10:31 PDT
GSkachkov
Comment 2 2017-03-29 12:13:22 PDT
I'll take look to this issue.
GSkachkov
Comment 3 2017-03-30 05:51:07 PDT
I'll upload patch soon, just need to make more proper tests
GSkachkov
Comment 4 2017-03-30 09:36:47 PDT
Created attachment 305864 [details] Patch Fix
Saam Barati
Comment 5 2017-03-30 10:06:42 PDT
Comment on attachment 305864 [details] Patch r=me
Build Bot
Comment 6 2017-03-30 14:29:44 PDT
Comment on attachment 305864 [details] Patch Attachment 305864 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3442729 New failing tests: js/string_replace_function.html js/string_replace_regexp.html
Build Bot
Comment 7 2017-03-30 14:29:45 PDT
Created attachment 305903 [details] Archive of layout-test-results from ews107 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 8 2017-03-30 14:40:04 PDT
Comment on attachment 305864 [details] Patch Attachment 305864 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3442751 New failing tests: js/string_replace_function.html js/string_replace_regexp.html
Build Bot
Comment 9 2017-03-30 14:40:05 PDT
Created attachment 305906 [details] Archive of layout-test-results from ews112 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 10 2017-03-30 14:43:28 PDT
Comment on attachment 305864 [details] Patch Attachment 305864 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3442798 New failing tests: js/string_replace_function.html js/string_replace_regexp.html
Build Bot
Comment 11 2017-03-30 14:43:29 PDT
Created attachment 305907 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 12 2017-03-30 15:08:56 PDT
Comment on attachment 305864 [details] Patch Attachment 305864 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3442825 New failing tests: js/string_replace_function.html js/string_replace_regexp.html
Build Bot
Comment 13 2017-03-30 15:08:58 PDT
Created attachment 305911 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
GSkachkov
Comment 14 2017-03-31 00:59:05 PDT
Created attachment 305952 [details] Patch Rebased version to check builds
GSkachkov
Comment 15 2017-03-31 05:09:31 PDT
Saam Barati
Comment 16 2017-04-13 19:08:08 PDT
(In reply to GSkachkov from comment #15) > Patch landed https://trac.webkit.org/changeset/214662 Please close out the bugs when landing fixes. Also, no need for r? on any patches once things have landed.
GSkachkov
Comment 17 2017-04-13 20:17:10 PDT
(In reply to Saam Barati from comment #16) > (In reply to GSkachkov from comment #15) > > Patch landed https://trac.webkit.org/changeset/214662 > > Please close out the bugs when landing fixes. Also, no need for r? on any > patches once things have landed. Sorry, but I don't have permissions to do this, I only can close bugs that I created. Yeah for this bugs I've have been waiting until webkit nightly starts works to ask authors to check fix and close the issue.
Saam Barati
Comment 18 2017-04-14 08:32:01 PDT
(In reply to GSkachkov from comment #17) > (In reply to Saam Barati from comment #16) > > (In reply to GSkachkov from comment #15) > > > Patch landed https://trac.webkit.org/changeset/214662 > > > > Please close out the bugs when landing fixes. Also, no need for r? on any > > patches once things have landed. > > Sorry, but I don't have permissions to do this, I only can close bugs that > I created. Yeah for this bugs I've have been waiting until webkit nightly > starts works to ask authors to check fix and close the issue. Ah, ok. Let me try to get you edit bugs privileges so you can close bugs you didn't create.
Note You need to log in before you can comment on or make changes to this bug.