<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Web Inspector: console.dir should expand objects"
href="https://bugs.webkit.org/show_bug.cgi?id=152039">152039</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Web Inspector: console.dir should expand objects
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>WebKit Local Build
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>Web Inspector
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nvasilyev@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>bburg@apple.com, graouts@webkit.org, joepeck@webkit.org, mattbaker@apple.com, nvasilyev@apple.com, timothy@apple.com, webkit-bug-importer@group.apple.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=266970" name="attach_266970" title="[Image] Actual/Expected">attachment 266970</a> <a href="attachment.cgi?id=266970&action=edit" title="[Image] Actual/Expected">[details]</a></span>
[Image] Actual/Expected
See the attached image.
console.log and console.dir of the following object shows a preview that isn't expandable (since it's lossless) and not very readable.
[
{
startOffset: 26,
endOffset: 65,
executionCount: 1
},
{
startOffset: 66,
endOffset: 76,
executionCount: 1000
},
{
startOffset: 77,
endOffset: 84,
executionCount: 1
},
{
startOffset: 85,
endOffset: 112,
executionCount: 1000
},
{
startOffset: 113,
endOffset: 151,
executionCount: 0
},
{
startOffset: 152,
endOffset: 161,
executionCount: 1
},
{
startOffset: 162,
endOffset: 171,
executionCount: 1000
},
{
startOffset: 172,
endOffset: 173,
executionCount: 1
}
])
Arrays with less than 10 items seem to be always logged as unexpandable (lossless) preview.
I had to add leading zeros to force it to be expandable.
I suggest always expand objects logged with console.dir and keep console.log as is.
This way it would be up to developers to decide which output they want.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>