Bug 158262

Summary: JSON.stringify replacer function calls with numeric array indices
Product: WebKit Reporter: Brian C <brian.carstensen>
Component: JavaScriptCoreAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Minor CC: benjamin, buildbot, commit-queue, ggaren, keith_miller, mark.lam, msaboff, rniwa, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 9   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews101 for mac-yosemite
none
Archive of layout-test-results from ews105 for mac-yosemite-wk2
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Archive of layout-test-results from ews117 for mac-yosemite
none
Patch none

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.