Bug 152330 - Web Inspector: Improve copy of console messages with multiple arguments - console.log(obj1, obj2)
Summary: Web Inspector: Improve copy of console messages with multiple arguments - con...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-12-16 00:28 PST by Joseph Pecoraro
Modified: 2015-12-16 09:44 PST (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (3.04 KB, patch)
2015-12-16 00:42 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-12-16 00:28:13 PST
* SUMMARY
Improve copy of console messages with multiple arguments - console.log(obj1, obj2)

* TEST
<script>
console.log("Message", 1, "string", /regex/);
console.log("Message", [1, 2], {x:10, y:20});
</script>

* STEPS TO REPRODUCE
1. Inspect test case
2. Reload (to ensure previews)
3. Select console messages
4. Copy
  => The actual data in the copy is missing!

BEFORE:

> [Log] Message (3) (copy.html, line 2)
> [Log] Message (2) (copy.html, line 3)

AFTER:

> [Log] Message (3) (copy.html, line 2)
> 1
> "string"
> /regex/
> 
> [Log] Message (2) (copy.html, line 3)
> [1, 2] (2)
> {x: 10, y: 20}
Comment 1 Radar WebKit Bug Importer 2015-12-16 00:28:26 PST
<rdar://problem/23916726>
Comment 2 Joseph Pecoraro 2015-12-16 00:40:05 PST
Another case: multiple arguments with call stack:

<script>
function foo() { console.error("Message", [1, 2], {x:10, y:20}); }
foo();
</script>


EXPECTED:

> [Error] Message (2)
> [1, 2] (2)
> {x: 10, y: 20}
> 	foo (copy.html:9)
> 	Global Code (copy.html:11)

Note the call stack coming after the arguments matches the UI here.
Comment 3 Joseph Pecoraro 2015-12-16 00:42:04 PST
Created attachment 267447 [details]
[PATCH] Proposed Fix
Comment 4 WebKit Commit Bot 2015-12-16 09:44:37 PST
Comment on attachment 267447 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 267447

Committed r194151: <http://trac.webkit.org/changeset/194151>
Comment 5 WebKit Commit Bot 2015-12-16 09:44:40 PST
All reviewed patches have been landed.  Closing bug.