<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181612] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181612">181612</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-16 21:41:31 -0700 (Mon, 16 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Better Console Previews for Arrays / Small Objects
https://bugs.webkit.org/show_bug.cgi?id=142322

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
Create deep valuePreviews for simple previewable objects,
such as arrays with 5 values, or basic objects with
3 properties.

Source/WebInspectorUI:

* UserInterface/Views/ObjectPreviewView.js:
If there is a sub-preview, show the sub-preview.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView):
For an ObjectTree that is not a root (e.g. one inside of
an array/set/map property tree element) allow it to be
expanded even if the preview is lossless.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Include a test with cyclic values, and update
results which now have sub-previews.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjecthtml">trunk/LayoutTests/inspector/model/remote-object.html</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/LayoutTests/ChangeLog        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Better Console Previews for Arrays / Small Objects
+        https://bugs.webkit.org/show_bug.cgi?id=142322
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+        Include a test with cyclic values, and update
+        results which now have sub-previews.
+
</ins><span class="cx"> 2015-03-16  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement default constructor
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -592,7 +592,7 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;array&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Array&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_size&quot;: 3,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="lines">@@ -600,19 +600,64 @@
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;1&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;1&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;2&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;2&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;3&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -678,24 +723,63 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;array&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Array&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_size&quot;: 3,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><del>-        &quot;_value&quot;: &quot;Object&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_description&quot;: &quot;Object&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;a&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;1&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;1&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><del>-        &quot;_value&quot;: &quot;Object&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_description&quot;: &quot;Object&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;b&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;2&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       },
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;2&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><del>-        &quot;_value&quot;: &quot;Object&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_description&quot;: &quot;Object&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;c&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;2&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -714,7 +798,7 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;array&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Array&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_size&quot;: 1,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="lines">@@ -722,7 +806,71 @@
</span><span class="cx">         &quot;_name&quot;: &quot;0&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 3,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;object&quot;,
+              &quot;_valuePreview&quot;: {
+                &quot;_type&quot;: &quot;object&quot;,
+                &quot;_description&quot;: &quot;Object&quot;,
+                &quot;_lossless&quot;: true,
+                &quot;_overflow&quot;: false,
+                &quot;_properties&quot;: [
+                  {
+                    &quot;_name&quot;: &quot;a&quot;,
+                    &quot;_type&quot;: &quot;number&quot;,
+                    &quot;_value&quot;: &quot;1&quot;
+                  }
+                ],
+                &quot;_entries&quot;: null
+              }
+            },
+            {
+              &quot;_name&quot;: &quot;1&quot;,
+              &quot;_type&quot;: &quot;object&quot;,
+              &quot;_valuePreview&quot;: {
+                &quot;_type&quot;: &quot;object&quot;,
+                &quot;_description&quot;: &quot;Object&quot;,
+                &quot;_lossless&quot;: true,
+                &quot;_overflow&quot;: false,
+                &quot;_properties&quot;: [
+                  {
+                    &quot;_name&quot;: &quot;b&quot;,
+                    &quot;_type&quot;: &quot;number&quot;,
+                    &quot;_value&quot;: &quot;2&quot;
+                  }
+                ],
+                &quot;_entries&quot;: null
+              }
+            },
+            {
+              &quot;_name&quot;: &quot;2&quot;,
+              &quot;_type&quot;: &quot;object&quot;,
+              &quot;_valuePreview&quot;: {
+                &quot;_type&quot;: &quot;object&quot;,
+                &quot;_description&quot;: &quot;Object&quot;,
+                &quot;_lossless&quot;: true,
+                &quot;_overflow&quot;: false,
+                &quot;_properties&quot;: [
+                  {
+                    &quot;_name&quot;: &quot;c&quot;,
+                    &quot;_type&quot;: &quot;number&quot;,
+                    &quot;_value&quot;: &quot;2&quot;
+                  }
+                ],
+                &quot;_entries&quot;: null
+              }
+            }
+          ],
+          &quot;_entries&quot;: null
+        }
</ins><span class="cx">       }
</span><span class="cx">     ],
</span><span class="cx">     &quot;_entries&quot;: null
</span><span class="lines">@@ -1554,6 +1702,33 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: o = {a:1}; o.b = o; o
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Object&quot;,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_description&quot;: &quot;Object&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;a&quot;,
+        &quot;_type&quot;: &quot;number&quot;,
+        &quot;_value&quot;: &quot;1&quot;
+      },
+      {
+        &quot;_name&quot;: &quot;b&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_value&quot;: &quot;Object&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: ({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -2948,14 +3123,23 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;iterator&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;ArrayIterator&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;array&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;,
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 0,
+          &quot;_properties&quot;: [],
+          &quot;_entries&quot;: null
+        },
</ins><span class="cx">         &quot;_internal&quot;: true
</span><span class="cx">       },
</span><span class="cx">       {
</span><span class="lines">@@ -2980,14 +3164,29 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;iterator&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;ArrayIterator&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;array&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Array&quot;,
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Array&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;1&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        },
</ins><span class="cx">         &quot;_internal&quot;: true
</span><span class="cx">       },
</span><span class="cx">       {
</span><span class="lines">@@ -3684,14 +3883,34 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;iterator&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;ArgumentsIterator&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;arguments&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">         &quot;_subtype&quot;: &quot;array&quot;,
</span><del>-        &quot;_value&quot;: &quot;Arguments&quot;,
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;array&quot;,
+          &quot;_description&quot;: &quot;Arguments&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_size&quot;: 2,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;0&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;1&quot;
+            },
+            {
+              &quot;_name&quot;: &quot;1&quot;,
+              &quot;_type&quot;: &quot;string&quot;,
+              &quot;_value&quot;: &quot;two&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        },
</ins><span class="cx">         &quot;_internal&quot;: true
</span><span class="cx">       }
</span><span class="cx">     ],
</span><span class="lines">@@ -3839,7 +4058,7 @@
</span><span class="cx">   &quot;_preview&quot;: {
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Promise&quot;,
</span><del>-    &quot;_lossless&quot;: false,
</del><ins>+    &quot;_lossless&quot;: true,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -3851,7 +4070,20 @@
</span><span class="cx">       {
</span><span class="cx">         &quot;_name&quot;: &quot;result&quot;,
</span><span class="cx">         &quot;_type&quot;: &quot;object&quot;,
</span><del>-        &quot;_value&quot;: &quot;Object&quot;,
</del><ins>+        &quot;_valuePreview&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_description&quot;: &quot;Object&quot;,
+          &quot;_lossless&quot;: true,
+          &quot;_overflow&quot;: false,
+          &quot;_properties&quot;: [
+            {
+              &quot;_name&quot;: &quot;result&quot;,
+              &quot;_type&quot;: &quot;number&quot;,
+              &quot;_value&quot;: &quot;1&quot;
+            }
+          ],
+          &quot;_entries&quot;: null
+        },
</ins><span class="cx">         &quot;_internal&quot;: true
</span><span class="cx">       }
</span><span class="cx">     ],
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">         {expression: &quot;({a: 1})&quot;},
</span><span class="cx">         {expression: &quot;({a: 1, b: 0, c: -0})&quot;},
</span><span class="cx">         {expression: &quot;({a: 1, b: \&quot;string\&quot;, c: /regex/, d: Symbol('sym')})&quot;},
</span><ins>+        {expression: &quot;o = {a:1}; o.b = o; o&quot;}, // Cyclic.
</ins><span class="cx">         {expression: &quot;({a:function a(){}, b:function b(){}, get getter(){}, set setter(v){}})&quot;},
</span><span class="cx">         {expression: &quot;function Foo() {}; new Foo&quot;},
</span><span class="cx">         {expression: &quot;var Foo2 = function() {}; new Foo2&quot;},
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Better Console Previews for Arrays / Small Objects
+        https://bugs.webkit.org/show_bug.cgi?id=142322
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InjectedScriptSource.js:
+        Create deep valuePreviews for simple previewable objects,
+        such as arrays with 5 values, or basic objects with
+        3 properties.
+
</ins><span class="cx"> 2015-03-16  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for default constructor
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -990,13 +990,14 @@
</span><span class="cx">                     return preview;
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if (preview.entries)
+                return preview;
+
</ins><span class="cx">             // Properties.
</span><span class="cx">             var descriptors = injectedScript._propertyDescriptors(object, InjectedScript.CollectionMode.AllProperties);
</span><span class="cx">             this._appendPropertyPreviews(preview, descriptors, false, propertiesThreshold, firstLevelKeys, secondLevelKeys);
</span><span class="cx">             if (propertiesThreshold.indexes &lt; 0 || propertiesThreshold.properties &lt; 0)
</span><span class="cx">                 return preview;
</span><del>-
-            // FIXME: Iterator entries.
</del><span class="cx">         } catch (e) {
</span><span class="cx">             preview.lossless = false;
</span><span class="cx">         }
</span><span class="lines">@@ -1093,6 +1094,13 @@
</span><span class="cx">                     preview.lossless = false;
</span><span class="cx">                 if (subPreview.overflow)
</span><span class="cx">                     preview.overflow = true;
</span><ins>+            } else if (this._isPreviewableObject(value)) {
+                var subPreview = this._createObjectPreviewForValue(value);
+                property.valuePreview = subPreview;
+                if (!subPreview.lossless)
+                    preview.lossless = false;
+                if (subPreview.overflow)
+                    preview.overflow = true;
</ins><span class="cx">             } else {
</span><span class="cx">                 var description = &quot;&quot;;
</span><span class="cx">                 if (type !== &quot;function&quot;)
</span><span class="lines">@@ -1145,6 +1153,57 @@
</span><span class="cx">         }, this);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _isPreviewableObject: function(object)
+    {
+        return this._isPreviewableObjectInternal(object, new Set, 1);
+    },
+
+    _isPreviewableObjectInternal: function(object, knownObjects, depth)
+    {
+        // Deep object.
+        if (depth &gt; 3)
+            return false;
+
+        // Primitive.
+        if (injectedScript.isPrimitiveValue(object) || isSymbol(object))
+            return true;
+
+        // Cyclic objects.
+        if (knownObjects.has(object))
+            return false;
+
+        ++depth;
+        knownObjects.add(object);
+
+        // Arrays are simple if they have 5 or less simple objects.
+        var subtype = injectedScript._subtype(object);
+        if (subtype === &quot;array&quot;) {
+            var length = object.length;
+            if (length &gt; 5)
+                return false;
+            for (var i = 0; i &lt; length; ++i) {
+                if (!this._isPreviewableObjectInternal(object[i], knownObjects, depth))
+                    return false;
+            }
+            return true;
+        }
+
+        // Not a basic object.
+        if (object.__proto__ &amp;&amp; object.__proto__.__proto__)
+            return false;
+
+        // Objects are simple if they have 3 or less simple properties.
+        var ownPropertyNames = Object.getOwnPropertyNames(object);
+        if (ownPropertyNames.length &gt; 3)
+            return false;
+        for (var propertyName of ownPropertyNames) {
+            if (!this._isPreviewableObjectInternal(object[propertyName], knownObjects, depth))
+                return false;
+        }
+
+        return true;
+    },
+
</ins><span class="cx">     _abbreviateString: function(string, maxLength, middle)
</span><span class="cx">     {
</span><span class="cx">         if (string.length &lt;= maxLength)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-03-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Better Console Previews for Arrays / Small Objects
+        https://bugs.webkit.org/show_bug.cgi?id=142322
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/ObjectPreviewView.js:
+        If there is a sub-preview, show the sub-preview.
+
+        * UserInterface/Views/ObjectTreeView.js:
+        (WebInspector.ObjectTreeView):
+        For an ObjectTree that is not a root (e.g. one inside of
+        an array/set/map property tree element) allow it to be
+        expanded even if the preview is lossless.
+
</ins><span class="cx"> 2015-03-16  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Rename ConsoleMessage and ConsoleMessageImpl to LegacyConsoleMessage and LegacyConsoleMessageImpl respectively
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -211,7 +211,10 @@
</span><span class="cx">                 element.appendChild(document.createTextNode(&quot;: &quot;));
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            element.appendChild(WebInspector.FormattedValue.createElementForPropertyPreview(property));
</del><ins>+            if (property.valuePreview)
+                this._appendPreview(element, property.valuePreview);
+            else
+                element.appendChild(WebInspector.FormattedValue.createElementForPropertyPreview(property));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (preview.overflow)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (181611 => 181612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-17 04:02:52 UTC (rev 181611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-17 04:41:31 UTC (rev 181612)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">         this._previewView.element.addEventListener(&quot;click&quot;, this._handlePreviewOrTitleElementClick.bind(this));
</span><span class="cx">         this._element.appendChild(this._previewView.element);
</span><span class="cx"> 
</span><del>-        if (this._previewView.lossless &amp;&amp; !forceExpanding) {
</del><ins>+        if (this._previewView.lossless &amp;&amp; !this._propertyPath.parent &amp;&amp; !forceExpanding) {
</ins><span class="cx">             this._hasLosslessPreview = true;
</span><span class="cx">             this.element.classList.add(&quot;lossless-preview&quot;);
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>