Bug 158262 - JSON.stringify replacer function calls with numeric array indices
Summary: JSON.stringify replacer function calls with numeric array indices
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Safari 9
Hardware: All All
: P2 Minor
Assignee: Benjamin Poulain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-01 08:28 PDT by Brian C
Modified: 2016-06-03 18:07 PDT (History)
10 users (show)

See Also:


Attachments
Patch (6.97 KB, patch)
2016-06-02 18:44 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (7.00 KB, patch)
2016-06-02 18:45 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (812.25 KB, application/zip)
2016-06-02 19:31 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (941.72 KB, application/zip)
2016-06-02 19:36 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews124 for ios-simulator-wk2 (666.45 KB, application/zip)
2016-06-02 19:41 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews117 for mac-yosemite (1.42 MB, application/zip)
2016-06-02 19:43 PDT, Build Bot
no flags Details
Patch (9.68 KB, patch)
2016-06-03 17:01 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian C 2016-06-01 08:28:58 PDT
Since

> typeof Object.keys(['a'])[0] === 'string';

I would expect

> JSON.stringify(['a'], function(key, value) {
>   console.log(typeof key);
>   return value;
> });

to log "string" twice. Instead it logs "string" and then "number".

Chrome and Firefox log "string" twice, as expected.
Comment 1 Benjamin Poulain 2016-06-02 17:27:03 PDT
I'll have a look.
Comment 2 Radar WebKit Bug Importer 2016-06-02 17:28:08 PDT
<rdar://problem/26613876>
Comment 3 Benjamin Poulain 2016-06-02 18:44:26 PDT
Created attachment 280396 [details]
Patch
Comment 4 Benjamin Poulain 2016-06-02 18:45:29 PDT
Created attachment 280397 [details]
Patch
Comment 5 Build Bot 2016-06-02 19:31:47 PDT
Comment on attachment 280397 [details]
Patch

Attachment 280397 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1426046

New failing tests:
js/dom/JSON-stringify.html
Comment 6 Build Bot 2016-06-02 19:31:51 PDT
Created attachment 280405 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-06-02 19:36:52 PDT
Comment on attachment 280397 [details]
Patch

Attachment 280397 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1426058

New failing tests:
js/dom/JSON-stringify.html
Comment 8 Build Bot 2016-06-02 19:36:56 PDT
Created attachment 280407 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2016-06-02 19:41:03 PDT
Comment on attachment 280397 [details]
Patch

Attachment 280397 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1426053

New failing tests:
js/dom/JSON-stringify.html
Comment 10 Build Bot 2016-06-02 19:41:06 PDT
Created attachment 280411 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 11 Build Bot 2016-06-02 19:43:46 PDT
Comment on attachment 280397 [details]
Patch

Attachment 280397 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1426057

New failing tests:
js/dom/JSON-stringify.html
Comment 12 Build Bot 2016-06-02 19:43:49 PDT
Created attachment 280414 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Benjamin Poulain 2016-06-03 00:40:33 PDT
Comment on attachment 280397 [details]
Patch

Looks like a test needs an update. I'll do that tomorrow.
Comment 14 Benjamin Poulain 2016-06-03 17:01:32 PDT
Created attachment 280485 [details]
Patch
Comment 15 Saam Barati 2016-06-03 17:08:56 PDT
Comment on attachment 280485 [details]
Patch

LGTM
Comment 16 WebKit Commit Bot 2016-06-03 18:07:06 PDT
Comment on attachment 280485 [details]
Patch

Clearing flags on attachment: 280485

Committed r201674: <http://trac.webkit.org/changeset/201674>
Comment 17 WebKit Commit Bot 2016-06-03 18:07:11 PDT
All reviewed patches have been landed.  Closing bug.