<!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>[193453] branches/safari-601.1.46-branch</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/193453">193453</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-04 12:53:40 -0800 (Fri, 04 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188403">r188403</a>. rdar://problem/23581597</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsinspectormodelremoteobjectexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsinspectormodelremoteobjecthtml">branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object.html</a></li>
<li><a href="#branchessafari601146branchSourceJavaScriptCoreChangeLog">branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceJavaScriptCoreinspectorInjectedScriptSourcejs">branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIChangeLog">branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs">branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2015-12-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r188403. rdar://problem/23581597
+
+    2015-08-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
+            https://bugs.webkit.org/show_bug.cgi?id=147966
+
+            Reviewed by Timothy Hatcher.
+
+            * inspector/model/remote-object.html:
+            * inspector/model/remote-object-expected.txt:
+            Add tests for a cylic array, set, and map.
+
+2015-12-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r187897. rdar://problem/23581597
</span><span class="cx"> 
</span><span class="cx">     2015-08-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object-expected.txt (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object-expected.txt        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object-expected.txt        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -843,6 +843,33 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: arr = []; arr[0] = arr; arr
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;array&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Array&quot;,
+  &quot;_size&quot;: 1,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;array&quot;,
+    &quot;_description&quot;: &quot;Array&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_size&quot;: 1,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;0&quot;,
+        &quot;_type&quot;: &quot;object&quot;,
+        &quot;_subtype&quot;: &quot;array&quot;,
+        &quot;_value&quot;: &quot;Array&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: arr = []; arr.length = 100; arr
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -2260,7 +2287,7 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;map&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Map&quot;,
</span><del>-    &quot;_lossless&quot;: true,
</del><ins>+    &quot;_lossless&quot;: false,
</ins><span class="cx">     &quot;_overflow&quot;: false,
</span><span class="cx">     &quot;_size&quot;: 2,
</span><span class="cx">     &quot;_properties&quot;: [],
</span><span class="lines">@@ -2469,6 +2496,49 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: map = new Map; map.set(map, map); map
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;map&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Map&quot;,
+  &quot;_size&quot;: 1,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;map&quot;,
+    &quot;_description&quot;: &quot;Map&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_size&quot;: 1,
+    &quot;_properties&quot;: [],
+    &quot;_entries&quot;: [
+      {
+        &quot;_key&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;map&quot;,
+          &quot;_description&quot;: &quot;Map&quot;,
+          &quot;_lossless&quot;: false,
+          &quot;_overflow&quot;: true,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [],
+          &quot;_entries&quot;: []
+        },
+        &quot;_value&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;map&quot;,
+          &quot;_description&quot;: &quot;Map&quot;,
+          &quot;_lossless&quot;: false,
+          &quot;_overflow&quot;: true,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [],
+          &quot;_entries&quot;: []
+        }
+      }
+    ]
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: map = new WeakMap; strongKey = {id:1}; map.set(strongKey, [1,2]); map
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><span class="lines">@@ -2609,7 +2679,7 @@
</span><span class="cx">     &quot;_type&quot;: &quot;object&quot;,
</span><span class="cx">     &quot;_subtype&quot;: &quot;set&quot;,
</span><span class="cx">     &quot;_description&quot;: &quot;Set&quot;,
</span><del>-    &quot;_lossless&quot;: true,
</del><ins>+    &quot;_lossless&quot;: false,
</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">@@ -2766,6 +2836,39 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: set = new Set; set.add(set); set
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;set&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Set&quot;,
+  &quot;_size&quot;: 1,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;set&quot;,
+    &quot;_description&quot;: &quot;Set&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_size&quot;: 1,
+    &quot;_properties&quot;: [],
+    &quot;_entries&quot;: [
+      {
+        &quot;_value&quot;: {
+          &quot;_type&quot;: &quot;object&quot;,
+          &quot;_subtype&quot;: &quot;set&quot;,
+          &quot;_description&quot;: &quot;Set&quot;,
+          &quot;_lossless&quot;: false,
+          &quot;_overflow&quot;: true,
+          &quot;_size&quot;: 1,
+          &quot;_properties&quot;: [],
+          &quot;_entries&quot;: []
+        }
+      }
+    ]
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: set = new WeakSet; strongKey = {id:1}; set.add(strongKey); set
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object.html (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object.html        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/LayoutTests/inspector/model/remote-object.html        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx">         {expression: &quot;[[undefined]]&quot;},
</span><span class="cx">         {expression: &quot;[{a:1}, {b:2}, {c:2}]&quot;},
</span><span class="cx">         {expression: &quot;[[{a:1}, {b:2}, {c:2}]]&quot;},
</span><ins>+        {expression: &quot;arr = []; arr[0] = arr; arr&quot;}, // cyclic
</ins><span class="cx">         {expression: &quot;arr = []; arr.length = 100; arr&quot;}, // 100 empty elements
</span><span class="cx">         {expression: &quot;arr = []; arr.length = 100; arr.fill(1)&quot;}, // 100 full elements
</span><span class="cx">         {expression: &quot;arr = []; arr.length = 100; arr[10] = 1; arr&quot;}, // sparse
</span><span class="lines">@@ -94,7 +95,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><del>-        {expression: &quot;o = {a:1}; o.b = o; o&quot;}, // Cyclic.
</del><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 class="lines">@@ -132,6 +133,7 @@
</span><span class="cx">         {expression: &quot;map = new Map; map.set(1, 2); map.set('key', 'value'); map&quot;},
</span><span class="cx">         {expression: &quot;map = new Map; map.set({a:1}, {b:2}); map.set(document.body, [1,2]); map&quot;},
</span><span class="cx">         {expression: &quot;map = new Map; for (var i = 0; i &lt;= 100; i++) map.set(i, i); map&quot;},
</span><ins>+        {expression: &quot;map = new Map; map.set(map, map); map&quot;},
</ins><span class="cx">         {expression: &quot;map = new WeakMap; strongKey = {id:1}; map.set(strongKey, [1,2]); map&quot;},
</span><span class="cx"> 
</span><span class="cx">         // Set / WeakSet
</span><span class="lines">@@ -139,6 +141,7 @@
</span><span class="cx">         {expression: &quot;set = new Set; set.add(1); set.add(2); set.add('key'); set&quot;},
</span><span class="cx">         {expression: &quot;set = new Set; set.add({a:1}); set.add(document.body); set.add([1,2]); set&quot;},
</span><span class="cx">         {expression: &quot;set = new Set; for (var i = 0; i &lt;= 100; i++) set.add(i); set&quot;},
</span><ins>+        {expression: &quot;set = new Set; set.add(set); set&quot;},
</ins><span class="cx">         {expression: &quot;set = new WeakSet; strongKey = {id:1}; set.add(strongKey); set&quot;},
</span><span class="cx"> 
</span><span class="cx">         // Iterators
</span></span></pre></div>
<a id="branchessafari601146branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/Source/JavaScriptCore/ChangeLog        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2015-12-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r188403. rdar://problem/23581597
+
+    2015-08-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
+            https://bugs.webkit.org/show_bug.cgi?id=147966
+
+            Reviewed by Timothy Hatcher.
+
+            * inspector/InjectedScriptSource.js:
+            (InjectedScript.prototype._initialPreview):
+            Renamed to initial preview. This is not a complete preview for
+            this object, and it needs some processing in order to be a
+            complete accurate preview.
+
+            (InjectedScript.RemoteObject.prototype._emptyPreview):
+            This attempts to be an accurate empty preview for the given object.
+            For types with entries, it adds an empty entries list and updates
+            the overflow and lossless properties.
+
+            (InjectedScript.RemoteObject.prototype._createObjectPreviewForValue):
+            Take a generatePreview parameter to generate a full preview or empty preview.
+
+            (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
+            (InjectedScript.RemoteObject.prototype._appendEntryPreviews):
+            (InjectedScript.RemoteObject.prototype._isPreviewableObject):
+            Take care to avoid cycles.
+
+2015-12-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
</ins><span class="cx">         Merge r187897. rdar://problem/23581597
</span><span class="cx"> 
</span><span class="cx">     2015-08-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -1018,7 +1018,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InjectedScript.RemoteObject.prototype = {
</span><del>-    _emptyPreview: function()
</del><ins>+    _initialPreview: function()
</ins><span class="cx">     {
</span><span class="cx">         var preview = {
</span><span class="cx">             type: this.type,
</span><span class="lines">@@ -1040,9 +1040,24 @@
</span><span class="cx">         return preview;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _createObjectPreviewForValue: function(value)
</del><ins>+    _emptyPreview: function()
</ins><span class="cx">     {
</span><del>-        var remoteObject = new InjectedScript.RemoteObject(value, undefined, false, true, undefined);
</del><ins>+        var preview = this._initialPreview();
+
+        if (this.subtype === &quot;map&quot; || this.subtype === &quot;set&quot; || this.subtype === &quot;weakmap&quot; || this.subtype === &quot;weakset&quot; || this.subtype === &quot;iterator&quot;) {
+            if (this.size) {
+                preview.entries = [];
+                preview.lossless = false;
+                preview.overflow = true;
+            }
+        }
+
+        return preview;
+    },
+
+    _createObjectPreviewForValue: function(value, generatePreview)
+    {
+        var remoteObject = new InjectedScript.RemoteObject(value, undefined, false, generatePreview, undefined);
</ins><span class="cx">         if (remoteObject.objectId)
</span><span class="cx">             injectedScript.releaseObject(remoteObject.objectId);
</span><span class="cx">         if (remoteObject.classPrototype &amp;&amp; remoteObject.classPrototype.objectId)
</span><span class="lines">@@ -1053,7 +1068,7 @@
</span><span class="cx"> 
</span><span class="cx">     _generatePreview: function(object, firstLevelKeys, secondLevelKeys)
</span><span class="cx">     {
</span><del>-        var preview = this._emptyPreview();
</del><ins>+        var preview = this._initialPreview();
</ins><span class="cx"> 
</span><span class="cx">         // Primitives just have a value.
</span><span class="cx">         if (this.type !== &quot;object&quot;)
</span><span class="lines">@@ -1077,7 +1092,7 @@
</span><span class="cx">             // Internal Properties.
</span><span class="cx">             var internalPropertyDescriptors = injectedScript._internalPropertyDescriptors(object, true);
</span><span class="cx">             if (internalPropertyDescriptors) {
</span><del>-                this._appendPropertyPreviews(preview, internalPropertyDescriptors, true, propertiesThreshold, firstLevelKeys, secondLevelKeys);
</del><ins>+                this._appendPropertyPreviews(object, preview, internalPropertyDescriptors, true, propertiesThreshold, firstLevelKeys, secondLevelKeys);
</ins><span class="cx">                 if (propertiesThreshold.indexes &lt; 0 || propertiesThreshold.properties &lt; 0)
</span><span class="cx">                     return preview;
</span><span class="cx">             }
</span><span class="lines">@@ -1087,7 +1102,7 @@
</span><span class="cx"> 
</span><span class="cx">             // Properties.
</span><span class="cx">             var descriptors = injectedScript._propertyDescriptors(object, InjectedScript.CollectionMode.AllProperties);
</span><del>-            this._appendPropertyPreviews(preview, descriptors, false, propertiesThreshold, firstLevelKeys, secondLevelKeys);
</del><ins>+            this._appendPropertyPreviews(object, preview, descriptors, false, propertiesThreshold, firstLevelKeys, secondLevelKeys);
</ins><span class="cx">             if (propertiesThreshold.indexes &lt; 0 || propertiesThreshold.properties &lt; 0)
</span><span class="cx">                 return preview;
</span><span class="cx">         } catch (e) {
</span><span class="lines">@@ -1097,7 +1112,7 @@
</span><span class="cx">         return preview;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _appendPropertyPreviews: function(preview, descriptors, internal, propertiesThreshold, firstLevelKeys, secondLevelKeys)
</del><ins>+    _appendPropertyPreviews: function(object, preview, descriptors, internal, propertiesThreshold, firstLevelKeys, secondLevelKeys)
</ins><span class="cx">     {
</span><span class="cx">         for (var descriptor of descriptors) {
</span><span class="cx">             // Seen enough.
</span><span class="lines">@@ -1180,9 +1195,9 @@
</span><span class="cx">                 property.subtype = subtype;
</span><span class="cx"> 
</span><span class="cx">             // Second level.
</span><del>-            if ((secondLevelKeys === null || secondLevelKeys) || this._isPreviewableObject(value)) {
</del><ins>+            if ((secondLevelKeys === null || secondLevelKeys) || this._isPreviewableObject(value, object)) {
</ins><span class="cx">                 // FIXME: If we want secondLevelKeys filter to continue we would need some refactoring.
</span><del>-                var subPreview = this._createObjectPreviewForValue(value);
</del><ins>+                var subPreview = this._createObjectPreviewForValue(value, value !== object);
</ins><span class="cx">                 property.valuePreview = subPreview;
</span><span class="cx">                 if (!subPreview.lossless)
</span><span class="cx">                     preview.lossless = false;
</span><span class="lines">@@ -1240,17 +1255,25 @@
</span><span class="cx">             preview.lossless = false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        function updateMainPreview(subPreview) {
+            if (!subPreview.lossless)
+                preview.lossless = false;
+        }
+
</ins><span class="cx">         preview.entries = entries.map(function(entry) {
</span><del>-            entry.value = this._createObjectPreviewForValue(entry.value);
-            if (&quot;key&quot; in entry)
-                entry.key = this._createObjectPreviewForValue(entry.key);
</del><ins>+            entry.value = this._createObjectPreviewForValue(entry.value, entry.value !== object);
+            updateMainPreview(entry.value);
+            if (&quot;key&quot; in entry) {
+                entry.key = this._createObjectPreviewForValue(entry.key, entry.key !== object);
+                updateMainPreview(entry.key);
+            }
</ins><span class="cx">             return entry;
</span><span class="cx">         }, this);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _isPreviewableObject: function(object)
</del><ins>+    _isPreviewableObject: function(value, object)
</ins><span class="cx">     {
</span><del>-        return this._isPreviewableObjectInternal(object, new Set, 1);
</del><ins>+        return this._isPreviewableObjectInternal(value, new Set([object]), 1);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _isPreviewableObjectInternal: function(object, knownObjects, depth)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/ChangeLog        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-12-04  Timothy Hatcher  &lt;timothy@apple.com&gt;
+
+        Merge r188403. rdar://problem/23581597
+
+    2015-08-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+            Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
+            https://bugs.webkit.org/show_bug.cgi?id=147966
+
+            Reviewed by Timothy Hatcher.
+
+            * UserInterface/Views/ObjectPreviewView.js:
+            (WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
+            (WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
+            For empty overflow previews, don't show &quot;, ...&quot; if we didn't show any
+            values; just show &quot;...&quot; in these cases.
+
</ins><span class="cx"> 2015-12-02  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r191967. rdar://problem/23221163
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebInspectorUIUserInterfaceViewsObjectPreviewViewjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js (193452 => 193453)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-12-04 20:53:33 UTC (rev 193452)
+++ branches/safari-601.1.46-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js        2015-12-04 20:53:40 UTC (rev 193453)
</span><span class="lines">@@ -177,10 +177,14 @@
</span><span class="cx">             overflow = true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (overflow)
-            element.appendChild(document.createTextNode(&quot;, \u2026&quot;));
-        element.appendChild(document.createTextNode(isIterator ? &quot;]&quot; : &quot;}&quot;));
</del><ins>+        if (overflow) {
+            if (limit &gt; 0)
+                element.append(&quot;, &quot;);
+            element.append(&quot;\u2026&quot;);
+        }
</ins><span class="cx"> 
</span><ins>+        element.append(isIterator ? &quot;]&quot; : &quot;}&quot;);
+
</ins><span class="cx">         return lossless;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -238,10 +242,14 @@
</span><span class="cx">             overflow = true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (overflow)
-            element.appendChild(document.createTextNode(&quot;, \u2026&quot;));
-        element.appendChild(document.createTextNode(isArray ? &quot;]&quot; : &quot;}&quot;));
</del><ins>+        if (overflow) {
+            if (limit &gt; 0)
+                element.append(&quot;, &quot;);
+            element.append(&quot;\u2026&quot;);
+        }
</ins><span class="cx"> 
</span><ins>+        element.append(isArray ? &quot;]&quot; : &quot;}&quot;);
+
</ins><span class="cx">         return lossless;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>