Bug 148605

Summary: Web Inspector: copy({x:1}) should copy "{x:1}", not "[object Object]"
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, buildbot, commit-queue, graouts, joepeck, mattbaker, nvasilyev, rniwa, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
bburg: review+, buildbot: commit-queue-
[PATCH] For Landing
none
Archive of layout-test-results from ews101 for mac-yosemite
none
Archive of layout-test-results from ews106 for mac-yosemite-wk2
none
Archive of layout-test-results from ews116 for mac-yosemite
none
[PATCH] For Landing
buildbot: commit-queue-
Archive of layout-test-results from ews102 for mac-yosemite
none
Archive of layout-test-results from ews117 for mac-yosemite
none
[PATCH] Try Again - For Bots
timothy: commit-queue-
Archive of layout-test-results from ews101 for mac-yosemite
none
Archive of layout-test-results from ews104 for mac-yosemite-wk2
none
Archive of layout-test-results from ews117 for mac-yosemite
none
Third Time is a Charm
buildbot: commit-queue-
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 ews113 for mac-yosemite
none
[PATCH] Attempt 4 for bots none

Description Nikita Vasilyev 2015-08-28 20:47:44 PDT
Steps:
1. Open console
2. Enter copy({x:1})
3. Press Command-V

Expected:
{x: 1}

Actual:
[object Object]


Possibly a regression.
Comment 1 Radar WebKit Bug Importer 2015-08-28 20:48:19 PDT
<rdar://problem/22487630>
Comment 2 Joseph Pecoraro 2015-12-15 14:54:31 PST
Created attachment 267395 [details]
[PATCH] Proposed Fix

Other browsers (FireFox and Chrome) seem to use formatting stringification `JSON.stringify(object, null, "  ")`, so this follows suit.
Comment 3 BJ Burg 2015-12-15 15:02:13 PST
Comment on attachment 267395 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=267395&action=review

r=me, this is awesome!

> LayoutTests/inspector/console/command-line-api-copy.html:24
> +    function commandLineAPICopyAndPaste(expression, callback) {

If you want to add a comment, then rename the function instead. Perhaps "copyAndPasteObjectUsingCommandLineAPI"
Comment 4 Joseph Pecoraro 2015-12-15 15:10:12 PST
Created attachment 267396 [details]
[PATCH] For Landing
Comment 5 Build Bot 2015-12-15 15:26:24 PST
Comment on attachment 267395 [details]
[PATCH] Proposed Fix

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 6 Build Bot 2015-12-15 15:26:26 PST
Created attachment 267399 [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 2015-12-15 15:31:23 PST
Comment on attachment 267395 [details]
[PATCH] Proposed Fix

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 8 Build Bot 2015-12-15 15:31:25 PST
Created attachment 267400 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2015-12-15 15:46:32 PST
Comment on attachment 267395 [details]
[PATCH] Proposed Fix

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 10 Build Bot 2015-12-15 15:46:34 PST
Created attachment 267403 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 11 Joseph Pecoraro 2015-12-15 15:54:34 PST
Created attachment 267407 [details]
[PATCH] For Landing

Interestingly, this adjusted some line numbers in warnings. I'll just rebase them.
Comment 12 Build Bot 2015-12-15 16:27:44 PST
Comment on attachment 267407 [details]
[PATCH] For Landing

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

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/interfaces.html
imported/w3c/web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html
imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml
imported/w3c/web-platform-tests/html/dom/interfaces.html
imported/w3c/web-platform-tests/XMLHttpRequest/timeout-sync.htm
imported/w3c/web-platform-tests/dom/interfaces.html
imported/w3c/web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html
imported/w3c/web-platform-tests/XMLHttpRequest/responsetype.html
Comment 13 Build Bot 2015-12-15 16:27:47 PST
Created attachment 267409 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 14 Build Bot 2015-12-15 16:38:20 PST
Comment on attachment 267407 [details]
[PATCH] For Landing

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

New failing tests:
imported/w3c/web-platform-tests/XMLHttpRequest/interfaces.html
imported/w3c/web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html
imported/w3c/web-platform-tests/dom/nodes/Node-isEqualNode.xhtml
imported/w3c/web-platform-tests/XMLHttpRequest/timeout-sync.htm
imported/w3c/web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html
imported/w3c/web-platform-tests/XMLHttpRequest/responsetype.html
Comment 15 Build Bot 2015-12-15 16:38:23 PST
Created attachment 267410 [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 16 Timothy Hatcher 2015-12-15 16:41:28 PST
Comment on attachment 267395 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=267395&action=review

> Source/WebCore/inspector/CommandLineAPIModuleSource.js:308
> +                string = JSON.stringify(object, null, "  ");

Why 2 space indent? Why not 4? (Interesting that you can also pass a number for the number of spaces instead of a string too, according to MDN.)
Comment 17 Joseph Pecoraro 2015-12-15 21:34:54 PST
(In reply to comment #16)
> > Source/WebCore/inspector/CommandLineAPIModuleSource.js:308
> > +                string = JSON.stringify(object, null, "  ");
> 
> Why 2 space indent? Why not 4? (Interesting that you can also pass a number
> for the number of spaces instead of a string too, according to MDN.)

2 matches what Firefox and Chrome did. I figured we should be consistent.
Comment 18 Joseph Pecoraro 2015-12-15 21:36:40 PST
Hmm, I don't know why so many tests have suddenly become flakey. I will have to investigate tomorrow.
Comment 19 Joseph Pecoraro 2015-12-16 01:03:53 PST
Created attachment 267449 [details]
[PATCH] Try Again - For Bots
Comment 20 Build Bot 2015-12-16 01:51:28 PST
Comment on attachment 267449 [details]
[PATCH] Try Again - For Bots

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 21 Build Bot 2015-12-16 01:51:32 PST
Created attachment 267452 [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 22 Build Bot 2015-12-16 01:54:18 PST
Comment on attachment 267449 [details]
[PATCH] Try Again - For Bots

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 23 Build Bot 2015-12-16 01:54:22 PST
Created attachment 267453 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 24 Build Bot 2015-12-16 01:56:35 PST
Comment on attachment 267449 [details]
[PATCH] Try Again - For Bots

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 25 Build Bot 2015-12-16 01:56:38 PST
Created attachment 267454 [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 26 Timothy Hatcher 2016-01-26 13:54:24 PST
Created attachment 269914 [details]
Third Time is a Charm
Comment 27 Build Bot 2016-01-26 14:21:34 PST
Comment on attachment 269914 [details]
Third Time is a Charm

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 28 Build Bot 2016-01-26 14:21:37 PST
Created attachment 269920 [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 29 Build Bot 2016-01-26 14:27:26 PST
Comment on attachment 269914 [details]
Third Time is a Charm

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 30 Build Bot 2016-01-26 14:27:29 PST
Created attachment 269922 [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 31 Build Bot 2016-01-26 14:49:40 PST
Comment on attachment 269914 [details]
Third Time is a Charm

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

New failing tests:
http/tests/inspector/console/cross-domain-inspected-node-access.html
Comment 32 Build Bot 2016-01-26 14:49:43 PST
Created attachment 269930 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 33 BJ Burg 2016-02-08 10:48:34 PST
Looks like this just needs to be rebased for new line numbers.
Comment 34 Joseph Pecoraro 2016-02-08 11:33:54 PST
Created attachment 270870 [details]
[PATCH] Attempt 4 for bots
Comment 35 WebKit Commit Bot 2016-02-08 13:50:29 PST
Comment on attachment 270870 [details]
[PATCH] Attempt 4 for bots

Clearing flags on attachment: 270870

Committed r196270: <http://trac.webkit.org/changeset/196270>
Comment 36 WebKit Commit Bot 2016-02-08 13:50:34 PST
All reviewed patches have been landed.  Closing bug.