<!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>[179349] 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/179349">179349</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-29 11:25:16 -0800 (Thu, 29 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: ES6: Improved Console Format for Set and Map Objects (like Arrays)
https://bugs.webkit.org/show_bug.cgi?id=122867

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Add new Runtime.RemoteObject object subtypes for &quot;map&quot;, &quot;set&quot;, and &quot;weakmap&quot;.

Upgrade Runtime.ObjectPreview to include type/subtype information. Now,
an ObjectPreview can be used for any value, in place of a RemoteObject,
and not capture / hold a reference to the value. The value will be in
the string description.

Adding this information to ObjectPreview can duplicate some information
in the protocol messages if a preview is provided, but simplifies
previews, so that all the information you need for any RemoteObject
preview is available. To slim messages further, make &quot;overflow&quot; and
&quot;properties&quot; only available on previews that may contain properties.
So, not primitives or null.

Finally, for &quot;Map/Set/WeakMap&quot; add an &quot;entries&quot; list to the preview
that will return previews with &quot;key&quot; and &quot;value&quot; properties depending
on the collection type. To get live, non-preview objects from a
collection, use Runtime.getCollectionEntries.

In order to keep the WeakMap's values Weak the frontend may provide
a unique object group name when getting collection entries. It may
then release that object group, e.g. when not showing the WeakMap's
values to the user, and thus remove the strong reference to the keys
so they may be garbage collected.

* runtime/WeakMapData.h:
(JSC::WeakMapData::begin):
(JSC::WeakMapData::end):
Expose iterators so the Inspector may access WeakMap keys/values.

* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
(Inspector::jsInjectedScriptHostPrototypeFunctionWeakMapEntries):
* inspector/JSInjectedScriptHost.h:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Discern &quot;map&quot;, &quot;set&quot;, and &quot;weakmap&quot; object subtypes.

(Inspector::JSInjectedScriptHost::weakMapEntries):
Return a list of WeakMap entries. These are strong references
that the Inspector code is responsible for releasing.

* inspector/protocol/Runtime.json:
Update types and expose the new getCollectionEntries command.

* inspector/agents/InspectorRuntimeAgent.h:
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getCollectionEntries):
* inspector/InjectedScript.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::getInternalProperties):
(Inspector::InjectedScript::getCollectionEntries):
Pass through to the InjectedScript and call getCollectionEntries.

* inspector/scripts/codegen/generator.py:
Add another type with runtime casting.

* inspector/InjectedScriptSource.js:
- Implement getCollectionEntries to get a range of values from a
collection. The non-Weak collections have an order to their keys (in
order of added) so range'd gets are okay. WeakMap does not have an
order, so only allow fetching a number of values.
- Update preview generation to address the Runtime.ObjectPreview
type changes.

Source/WebInspectorUI:

This includes Set/Map/WeakMap previews:

    - Set previews: Set {1, 2, 3}
    - Map/WeakMap previews: Map {1 =&gt; 2, &quot;key&quot; =&gt; &quot;value&quot;}

For WeakMaps:

    - the preview itself shows up to 5 key/value pairs from when the object was logged
    - the previews are strings only, and thus do not retain the actual keys/values
    - when expanding, we get RemoteObjects and strongly retain the keys/values
    - when collapsing / clearing, we release the RemoteObjects so they can get collected

Currently you collapse the &lt;entries&gt; section, and re-expand later the
collection may show you knew keys/values. The UI for this will change.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.isCollectionType):
(WebInspector.RemoteObject.prototype.isWeakCollection):
(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.releaseWeakCollectionEntries):
(WebInspector.RemoteObject.prototype.arrayLength):
(WebInspector.RemoteObject.prototype._weakCollectionObjectGroup):
High level functions for dealing with a RemoteObject that may be a
collection / weak collection.

* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject):
Include default formatters for collection types.

(WebInspector.ConsoleMessageImpl.prototype._appendPreview):
(WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews):
(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews):
(WebInspector.ConsoleMessageImpl.prototype._appendValuePreview):
(WebInspector.ConsoleMessageImpl.prototype._appendObjectPreview): Deleted.
Refactor preview generation a bit and include a specific path for
generation the output of a preview with &quot;entries&quot;.

* UserInterface/Views/LogContentView.css:
(.console-object-preview-body .console-object-preview-name.console-object-preview-name-Object):
With nested Object previews (&quot;Map {{a:1} =&gt; 1}&quot;) don't show &quot;Object&quot; for the inner
object preview. Only show it if it has a unique type (&quot;Map {Foo {a:1} =&gt; 1}&quot;)

(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap):
(:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .section):
(:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .properties):
Make map/set/weakmap display like Objects.

* UserInterface/Views/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertiesSection.prototype.update):
(WebInspector.ObjectPropertiesSection.prototype.updateProperties):
(WebInspector.ObjectPropertyTreeElement.prototype.onpopulate.callback):
(WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
(WebInspector.CollectionEntriesMainTreeElement):
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback):
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand):
(WebInspector.CollectionEntriesMainTreeElement.prototype.oncollapse):
(WebInspector.CollectionEntriesMainTreeElement.prototype.ondetach):
(WebInspector.CollectionEntriesMainTreeElement.prototype._trackWeakEntries):
(WebInspector.CollectionEntriesMainTreeElement.prototype._untrackWeakEntries):
(WebInspector.CollectionEntryTreeElement):
(WebInspector.CollectionEntryTreeElement.prototype.onpopulate):
(WebInspector.CollectionEntryTreeElement.prototype.onattach):
(WebInspector.EmptyCollectionTreeElement):
(WebInspector.ObjectPropertiesSection.prototype.update.callback): Deleted.
Add a quick UI for exploring the entries of a collection. We are actively
changing the styles of objects in the Console, so this should change soon.

LayoutTests:

* TestExpectations:
The test unexpectedly fails in Debug builds, so skip it.

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Update based on Runtime.ObjectPreview changes.

* inspector/model/remote-object-weak-collection-expected.txt: Added.
* inspector/model/remote-object-weak-collection.html: Added.
New test for weak collection handling.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</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="#trunkSourceJavaScriptCoreinspectorInjectedScriptcpp">trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScripth">trunk/Source/JavaScriptCore/inspector/InjectedScript.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorscriptscodegengeneratorpy">trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakMapDatah">trunk/Source/JavaScriptCore/runtime/WeakMapData.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss">trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectweakcollectionexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-weak-collection-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectweakcollectionhtml">trunk/LayoutTests/inspector/model/remote-object-weak-collection.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/LayoutTests/ChangeLog        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-01-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Improved Console Format for Set and Map Objects (like Arrays)
+        https://bugs.webkit.org/show_bug.cgi?id=122867
+
+        Reviewed by Timothy Hatcher.
+
+        * TestExpectations:
+        Inspector tests are still flakey on bots, so skip the test.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+        Update based on Runtime.ObjectPreview changes.
+
+        * inspector/model/remote-object-weak-collection-expected.txt: Added.
+        * inspector/model/remote-object-weak-collection.html: Added.
+        New test for weak collection handling.
+
</ins><span class="cx"> 2015-01-28  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         security/mixedContent/redirect-https-to-http-iframe-in-main-frame test is the same as security/mixedContent/redirect-http-to-https-iframe-in-main-frame.html
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/LayoutTests/TestExpectations        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx"> webkit.org/b/137130 inspector/replay [ Skip ]
</span><span class="cx"> webkit.org/b/137131 inspector/timeline [ Skip ]
</span><span class="cx"> inspector/model/remote-object-get-properties.html [ Skip ]
</span><ins>+inspector/model/remote-object-weak-collection.html [ Skip ]
</ins><span class="cx"> inspector/model/remote-object.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> # Doesn't work yet, relies on network replay functionality (webkit.org/b/130728, webkit.org/b/129391)
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -231,7 +231,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/ /&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/ /&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -271,7 +274,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/(?:)/&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/(?:)/&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -311,7 +317,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/^r(e)g[e]{1,}x+/&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/^r(e)g[e]{1,}x+/&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -351,7 +360,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/^r(e)g[e]{1,}x+/gi&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/^r(e)g[e]{1,}x+/gi&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -391,7 +403,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/(?:)/&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/(?:)/&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -431,7 +446,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;/test/i&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;/test/i&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;regexp&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -471,7 +489,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[0]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[0]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="lines">@@ -485,7 +506,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[2]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[2]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -510,7 +534,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[3]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[3]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -543,7 +570,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[5]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[5]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -577,6 +607,63 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: [{a:1}, {b:2}, {c:2}]
+{
+  &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[3]&quot;,
+  &quot;_preview&quot;: {
+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[3]&quot;,
+    &quot;lossless&quot;: false,
+    &quot;subtype&quot;: &quot;array&quot;,
+    &quot;overflow&quot;: false,
+    &quot;properties&quot;: [
+      {
+        &quot;name&quot;: &quot;0&quot;,
+        &quot;type&quot;: &quot;object&quot;,
+        &quot;value&quot;: &quot;Object&quot;
+      },
+      {
+        &quot;name&quot;: &quot;1&quot;,
+        &quot;type&quot;: &quot;object&quot;,
+        &quot;value&quot;: &quot;Object&quot;
+      },
+      {
+        &quot;name&quot;: &quot;2&quot;,
+        &quot;type&quot;: &quot;object&quot;,
+        &quot;value&quot;: &quot;Object&quot;
+      }
+    ]
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: [[{a:1}, {b:2}, {c:2}]]
+{
+  &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[1]&quot;,
+  &quot;_preview&quot;: {
+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[1]&quot;,
+    &quot;lossless&quot;: false,
+    &quot;subtype&quot;: &quot;array&quot;,
+    &quot;overflow&quot;: false,
+    &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[3]&quot;
+      }
+    ]
+  }
+}
+
+-----------------------------------------------------
</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">@@ -584,7 +671,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[100]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[100]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="lines">@@ -598,7 +688,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[100]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[100]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1113,7 +1206,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Array[100]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Array[100]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1133,7 +1229,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Arguments[3]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Arguments[3]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1164,7 +1263,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Int32Array[4]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Int32Array[4]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1214,7 +1316,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Int32Array[4]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Int32Array[4]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1263,8 +1368,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -1276,8 +1382,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;a&quot;,
</span><span class="lines">@@ -1295,8 +1402,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;a&quot;,
</span><span class="lines">@@ -1325,8 +1433,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;a&quot;,
</span><span class="lines">@@ -1357,8 +1466,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Foo&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Foo&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -1370,8 +1480,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Bar&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Bar&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;_x&quot;,
</span><span class="lines">@@ -1398,8 +1509,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Event&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Event&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><del>-    &quot;overflow&quot;: true,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;clipboardData&quot;,
</span><span class="lines">@@ -1427,7 +1539,8 @@
</span><span class="cx">         &quot;type&quot;: &quot;number&quot;,
</span><span class="cx">         &quot;value&quot;: &quot;2&quot;
</span><span class="cx">       }
</span><del>-    ]
</del><ins>+    ],
+    &quot;overflow&quot;: true
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1438,8 +1551,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;ArrayBuffer&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;ArrayBuffer&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;byteLength&quot;,
</span><span class="lines">@@ -1457,8 +1571,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;DataView&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;DataView&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="cx">         &quot;name&quot;: &quot;byteOffset&quot;,
</span><span class="lines">@@ -1487,7 +1602,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;body&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;body&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;node&quot;,
</ins><span class="cx">     &quot;overflow&quot;: true,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1527,7 +1645,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;div.foo.bar&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;div.foo.bar&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;node&quot;,
</ins><span class="cx">     &quot;overflow&quot;: true,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1567,7 +1688,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;span#foo&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;span#foo&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;node&quot;,
</ins><span class="cx">     &quot;overflow&quot;: true,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1607,7 +1731,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;#text&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;#text&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;node&quot;,
</ins><span class="cx">     &quot;overflow&quot;: true,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1647,7 +1774,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;HTMLCollection[3]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;HTMLCollection[3]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1690,7 +1820,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;NodeList[3]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;NodeList[3]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1733,7 +1866,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;NodeList[3]&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;NodeList[3]&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;array&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1776,7 +1912,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;TypeError: undefined is not an object (evaluating '[].x.x')&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;TypeError: undefined is not an object (evaluating '[].x.x')&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;error&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1811,7 +1950,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;SyntaxError: Unexpected token ')'&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;SyntaxError: Unexpected token ')'&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;error&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1846,7 +1988,10 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Error: IndexSizeError: DOM Exception 1&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Error: IndexSizeError: DOM Exception 1&quot;,
</ins><span class="cx">     &quot;lossless&quot;: false,
</span><ins>+    &quot;subtype&quot;: &quot;error&quot;,
</ins><span class="cx">     &quot;overflow&quot;: true,
</span><span class="cx">     &quot;properties&quot;: [
</span><span class="cx">       {
</span><span class="lines">@@ -1885,8 +2030,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -1898,8 +2044,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Object&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Object&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -1908,12 +2055,17 @@
</span><span class="cx"> EXPRESSION: new Map
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;map&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Map&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Map&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;map&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: []
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1921,12 +2073,42 @@
</span><span class="cx"> EXPRESSION: map = new Map; map.set(1, 2); map.set('key', 'value'); map
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;map&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Map&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Map&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;map&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;1&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;2&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;string&quot;,
+          &quot;description&quot;: &quot;key&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;string&quot;,
+          &quot;description&quot;: &quot;value&quot;,
+          &quot;lossless&quot;: true
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1934,12 +2116,99 @@
</span><span class="cx"> EXPRESSION: map = new Map; map.set({a:1}, {b:2}); map.set(document.body, [1,2]); map
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;map&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Map&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Map&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;map&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Object&quot;,
+          &quot;lossless&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;a&quot;,
+              &quot;type&quot;: &quot;number&quot;,
+              &quot;value&quot;: &quot;1&quot;
+            }
+          ]
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Object&quot;,
+          &quot;lossless&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;b&quot;,
+              &quot;type&quot;: &quot;number&quot;,
+              &quot;value&quot;: &quot;2&quot;
+            }
+          ]
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;body&quot;,
+          &quot;lossless&quot;: false,
+          &quot;subtype&quot;: &quot;node&quot;,
+          &quot;overflow&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;aLink&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;background&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;bgColor&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;link&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;text&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            }
+          ]
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Array[2]&quot;,
+          &quot;lossless&quot;: true,
+          &quot;subtype&quot;: &quot;array&quot;,
+          &quot;overflow&quot;: false,
+          &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;number&quot;,
+              &quot;value&quot;: &quot;2&quot;
+            }
+          ]
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1947,25 +2216,130 @@
</span><span class="cx"> EXPRESSION: map = new Map; for (var i = 0; i &lt;= 100; i++) map.set(i, i); map
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;map&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Map&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><del>-    &quot;lossless&quot;: true,
-    &quot;overflow&quot;: false,
-    &quot;properties&quot;: []
</del><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Map&quot;,
+    &quot;lossless&quot;: false,
+    &quot;subtype&quot;: &quot;map&quot;,
+    &quot;overflow&quot;: true,
+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;0&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;0&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;1&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;1&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;2&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;2&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;3&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;3&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;4&quot;,
+          &quot;lossless&quot;: true
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;4&quot;,
+          &quot;lossless&quot;: true
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><del>-EXPRESSION: map = new WeakMap; map.set({id:1}, [1,2]); map
</del><ins>+EXPRESSION: map = new WeakMap; strongKey = {id:1}; map.set(strongKey, [1,2]); map
</ins><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;weakmap&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;WeakMap&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;WeakMap&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;weakmap&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;key&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Object&quot;,
+          &quot;lossless&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;id&quot;,
+              &quot;type&quot;: &quot;number&quot;,
+              &quot;value&quot;: &quot;1&quot;
+            }
+          ]
+        },
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Array[2]&quot;,
+          &quot;lossless&quot;: true,
+          &quot;subtype&quot;: &quot;array&quot;,
+          &quot;overflow&quot;: false,
+          &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;number&quot;,
+              &quot;value&quot;: &quot;2&quot;
+            }
+          ]
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1973,12 +2347,17 @@
</span><span class="cx"> EXPRESSION: new Set
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;set&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Set&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Set&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;set&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: []
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1986,12 +2365,39 @@
</span><span class="cx"> EXPRESSION: set = new Set; set.add(1); set.add(2); set.add('key'); set
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;set&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Set&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Set&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;set&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;1&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;2&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;string&quot;,
+          &quot;description&quot;: &quot;key&quot;,
+          &quot;lossless&quot;: true
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1999,12 +2405,89 @@
</span><span class="cx"> EXPRESSION: set = new Set; set.add({a:1}); set.add(document.body); set.add([1,2]); set
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;set&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Set&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Set&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><ins>+    &quot;subtype&quot;: &quot;set&quot;,
</ins><span class="cx">     &quot;overflow&quot;: false,
</span><del>-    &quot;properties&quot;: []
</del><ins>+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Object&quot;,
+          &quot;lossless&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;a&quot;,
+              &quot;type&quot;: &quot;number&quot;,
+              &quot;value&quot;: &quot;1&quot;
+            }
+          ]
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;body&quot;,
+          &quot;lossless&quot;: false,
+          &quot;subtype&quot;: &quot;node&quot;,
+          &quot;overflow&quot;: true,
+          &quot;properties&quot;: [
+            {
+              &quot;name&quot;: &quot;aLink&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;background&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;bgColor&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;link&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            },
+            {
+              &quot;name&quot;: &quot;text&quot;,
+              &quot;type&quot;: &quot;string&quot;,
+              &quot;value&quot;: &quot;&quot;
+            }
+          ]
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;object&quot;,
+          &quot;description&quot;: &quot;Array[2]&quot;,
+          &quot;lossless&quot;: true,
+          &quot;subtype&quot;: &quot;array&quot;,
+          &quot;overflow&quot;: false,
+          &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;number&quot;,
+              &quot;value&quot;: &quot;2&quot;
+            }
+          ]
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2012,12 +2495,53 @@
</span><span class="cx"> EXPRESSION: set = new Set; for (var i = 0; i &lt;= 100; i++) set.add(i); set
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span><ins>+  &quot;_subtype&quot;: &quot;set&quot;,
</ins><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Set&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><del>-    &quot;lossless&quot;: true,
-    &quot;overflow&quot;: false,
-    &quot;properties&quot;: []
</del><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Set&quot;,
+    &quot;lossless&quot;: false,
+    &quot;subtype&quot;: &quot;set&quot;,
+    &quot;overflow&quot;: true,
+    &quot;properties&quot;: [],
+    &quot;entries&quot;: [
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;0&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;1&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;2&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;3&quot;,
+          &quot;lossless&quot;: true
+        }
+      },
+      {
+        &quot;value&quot;: {
+          &quot;type&quot;: &quot;number&quot;,
+          &quot;description&quot;: &quot;4&quot;,
+          &quot;lossless&quot;: true
+        }
+      }
+    ]
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2028,8 +2552,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Promise&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Promise&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -2041,8 +2566,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Promise&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Promise&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span><span class="lines">@@ -2054,8 +2580,9 @@
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><span class="cx">   &quot;_description&quot;: &quot;Promise&quot;,
</span><span class="cx">   &quot;_preview&quot;: {
</span><ins>+    &quot;type&quot;: &quot;object&quot;,
+    &quot;description&quot;: &quot;Promise&quot;,
</ins><span class="cx">     &quot;lossless&quot;: true,
</span><del>-    &quot;overflow&quot;: false,
</del><span class="cx">     &quot;properties&quot;: []
</span><span class="cx">   }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectweakcollectionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/remote-object-weak-collection-expected.txt (0 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-weak-collection-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/model/remote-object-weak-collection-expected.txt        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+
+-----------------------------------------------------
+EXPRESSION:  weakMap
+ENTRIES:
+[]
+
+-----------------------------------------------------
+EXPRESSION: weakMap.set(strongKey1, 1); weakMap.set(strongKey2, 2); weakMap
+ENTRIES:
+[
+  {
+    &quot;key&quot;: {
+      &quot;type&quot;: &quot;object&quot;,
+      &quot;objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;className&quot;: &quot;Object&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;: true,
+        &quot;properties&quot;: [
+          {
+            &quot;name&quot;: &quot;id&quot;,
+            &quot;type&quot;: &quot;number&quot;,
+            &quot;value&quot;: &quot;1&quot;
+          }
+        ]
+      }
+    },
+    &quot;value&quot;: {
+      &quot;type&quot;: &quot;number&quot;,
+      &quot;value&quot;: 1,
+      &quot;description&quot;: &quot;1&quot;
+    }
+  },
+  {
+    &quot;key&quot;: {
+      &quot;type&quot;: &quot;object&quot;,
+      &quot;objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;className&quot;: &quot;Object&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;: true,
+        &quot;properties&quot;: [
+          {
+            &quot;name&quot;: &quot;id&quot;,
+            &quot;type&quot;: &quot;number&quot;,
+            &quot;value&quot;: &quot;2&quot;
+          }
+        ]
+      }
+    },
+    &quot;value&quot;: {
+      &quot;type&quot;: &quot;number&quot;,
+      &quot;value&quot;: 2,
+      &quot;description&quot;: &quot;2&quot;
+    }
+  }
+]
+
+-----------------------------------------------------
+EXPRESSION: delete window.strongKey1; weakMap
+ENTRIES:
+[
+  {
+    &quot;key&quot;: {
+      &quot;type&quot;: &quot;object&quot;,
+      &quot;objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;className&quot;: &quot;Object&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;: true,
+        &quot;properties&quot;: [
+          {
+            &quot;name&quot;: &quot;id&quot;,
+            &quot;type&quot;: &quot;number&quot;,
+            &quot;value&quot;: &quot;2&quot;
+          }
+        ]
+      }
+    },
+    &quot;value&quot;: {
+      &quot;type&quot;: &quot;number&quot;,
+      &quot;value&quot;: 2,
+      &quot;description&quot;: &quot;2&quot;
+    }
+  }
+]
+
+-----------------------------------------------------
+EXPRESSION: weakMap.set({id:3}, 3); weakMap.set({id:4}, 4); weakMap
+ENTRIES:
+[
+  {
+    &quot;key&quot;: {
+      &quot;type&quot;: &quot;object&quot;,
+      &quot;objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+      &quot;className&quot;: &quot;Object&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;: true,
+        &quot;properties&quot;: [
+          {
+            &quot;name&quot;: &quot;id&quot;,
+            &quot;type&quot;: &quot;number&quot;,
+            &quot;value&quot;: &quot;2&quot;
+          }
+        ]
+      }
+    },
+    &quot;value&quot;: {
+      &quot;type&quot;: &quot;number&quot;,
+      &quot;value&quot;: 2,
+      &quot;description&quot;: &quot;2&quot;
+    }
+  }
+]
+
+-----------------------------------------------------
+EXPRESSION: delete window.strongKey2; weakMap
+ENTRIES:
+[]
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectweakcollectionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/remote-object-weak-collection.html (0 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-weak-collection.html                                (rev 0)
+++ trunk/LayoutTests/inspector/model/remote-object-weak-collection.html        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;../../http/tests/inspector/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+strongKey1 = {id:1};
+strongKey2 = {id:2};
+weakMap = new WeakMap;
+
+function test()
+{
+    var weakMapObjectId = null;
+
+    var currentStepIndex = 0;
+    var steps = [
+        // WeakMap {}
+        {expression: &quot;&quot;},
+        
+        // WeakMap {key1 =&gt; 1, key2 =&gt; 2}
+        {expression: &quot;weakMap.set(strongKey1, 1); weakMap.set(strongKey2, 2);&quot;},
+        
+        // WeakMap {key2 =&gt; 2}
+        {expression: &quot;delete window.strongKey1;&quot;},
+
+        // WeakMap {key2 =&gt; 2} (add and immediately garbage collect temporary objects)
+        {expression: &quot;weakMap.set({id:3}, 3); weakMap.set({id:4}, 4);&quot;},
+        
+        // WeakMap {}
+        {expression: &quot;delete window.strongKey2;&quot;},
+    ];
+
+    function remoteObjectJSONFilter(key, value)
+    {
+        if (key === &quot;objectId&quot;)
+            return &quot;&lt;filtered&gt;&quot;;
+
+        return value;
+    }
+
+    function runNextStep() {
+        if (currentStepIndex &gt;= steps.length) {
+            InspectorTest.completeTest();
+            return;
+        }
+
+        var step = steps[currentStepIndex++];
+        step.expression += &quot; weakMap&quot;;
+
+        InspectorTest.log(&quot;&quot;);
+        InspectorTest.log(&quot;-----------------------------------------------------&quot;);
+        InspectorTest.log(&quot;EXPRESSION: &quot; + step.expression);
+
+        // Run the expression, and then run a garbage collection on a different
+        // event loop so no objects are kept alive by the stack.
+        WebInspector.runtimeManager.evaluateInInspectedWindow(step.expression, &quot;test&quot;, false, true, false, true, function(remoteObject, wasThrown) {
+            WebInspector.runtimeManager.evaluateInInspectedWindow(&quot;GCController.collect()&quot;, &quot;test&quot;, false, true, false, false, function() {
+                InspectorTest.assert(remoteObject instanceof WebInspector.RemoteObject);
+                remoteObject.getCollectionEntries(0, 100, function(entries) {
+                    InspectorTest.log(&quot;ENTRIES:&quot;);
+                    entries.sort(function(a, b) { return a.value.value - b.value.value; });
+                    InspectorTest.log(JSON.stringify(entries, remoteObjectJSONFilter, &quot;  &quot;));
+                    remoteObject.releaseWeakCollectionEntries();
+                    runNextStep();
+                });
+            });
+        });
+    }
+
+    runNextStep();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest();&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -69,6 +69,8 @@
</span><span class="cx">         {expression: &quot;[1, 2]&quot;},
</span><span class="cx">         {expression: &quot;[[1],[2],[3]]&quot;},
</span><span class="cx">         {expression: &quot;[true, 1, 1.234, 'string', /regex/]&quot;},
</span><ins>+        {expression: &quot;[{a:1}, {b:2}, {c:2}]&quot;},
+        {expression: &quot;[[{a:1}, {b:2}, {c:2}]]&quot;},
</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">@@ -117,7 +119,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><del>-        {expression: &quot;map = new WeakMap; map.set({id:1}, [1,2]); map&quot;},
</del><ins>+        {expression: &quot;map = new WeakMap; strongKey = {id:1}; map.set(strongKey, [1,2]); map&quot;},
</ins><span class="cx"> 
</span><span class="cx">         // Set
</span><span class="cx">         {expression: &quot;new Set&quot;},
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -1,3 +1,75 @@
</span><ins>+2015-01-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Improved Console Format for Set and Map Objects (like Arrays)
+        https://bugs.webkit.org/show_bug.cgi?id=122867
+
+        Reviewed by Timothy Hatcher.
+
+        Add new Runtime.RemoteObject object subtypes for &quot;map&quot;, &quot;set&quot;, and &quot;weakmap&quot;.
+
+        Upgrade Runtime.ObjectPreview to include type/subtype information. Now,
+        an ObjectPreview can be used for any value, in place of a RemoteObject,
+        and not capture / hold a reference to the value. The value will be in
+        the string description.
+
+        Adding this information to ObjectPreview can duplicate some information
+        in the protocol messages if a preview is provided, but simplifies
+        previews, so that all the information you need for any RemoteObject
+        preview is available. To slim messages further, make &quot;overflow&quot; and
+        &quot;properties&quot; only available on previews that may contain properties.
+        So, not primitives or null.
+
+        Finally, for &quot;Map/Set/WeakMap&quot; add an &quot;entries&quot; list to the preview
+        that will return previews with &quot;key&quot; and &quot;value&quot; properties depending
+        on the collection type. To get live, non-preview objects from a
+        collection, use Runtime.getCollectionEntries.
+
+        In order to keep the WeakMap's values Weak the frontend may provide
+        a unique object group name when getting collection entries. It may
+        then release that object group, e.g. when not showing the WeakMap's
+        values to the user, and thus remove the strong reference to the keys
+        so they may be garbage collected.
+
+        * runtime/WeakMapData.h:
+        (JSC::WeakMapData::begin):
+        (JSC::WeakMapData::end):
+        Expose iterators so the Inspector may access WeakMap keys/values.
+
+        * inspector/JSInjectedScriptHostPrototype.cpp:
+        (Inspector::JSInjectedScriptHostPrototype::finishCreation):
+        (Inspector::jsInjectedScriptHostPrototypeFunctionWeakMapEntries):
+        * inspector/JSInjectedScriptHost.h:
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::subtype):
+        Discern &quot;map&quot;, &quot;set&quot;, and &quot;weakmap&quot; object subtypes.
+
+        (Inspector::JSInjectedScriptHost::weakMapEntries):
+        Return a list of WeakMap entries. These are strong references
+        that the Inspector code is responsible for releasing.
+
+        * inspector/protocol/Runtime.json:
+        Update types and expose the new getCollectionEntries command.
+
+        * inspector/agents/InspectorRuntimeAgent.h:
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::InspectorRuntimeAgent::getCollectionEntries):
+        * inspector/InjectedScript.h:
+        * inspector/InjectedScript.cpp:
+        (Inspector::InjectedScript::getInternalProperties):
+        (Inspector::InjectedScript::getCollectionEntries):
+        Pass through to the InjectedScript and call getCollectionEntries.
+
+        * inspector/scripts/codegen/generator.py:
+        Add another type with runtime casting.
+
+        * inspector/InjectedScriptSource.js:
+        - Implement getCollectionEntries to get a range of values from a
+        collection. The non-Weak collections have an order to their keys (in
+        order of added) so range'd gets are okay. WeakMap does not have an
+        order, so only allow fetching a number of values.
+        - Update preview generation to address the Runtime.ObjectPreview
+        type changes.
+
</ins><span class="cx"> 2015-01-28  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScript.cpp        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -137,10 +137,27 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto array = BindingTraits&lt;Array&lt;Inspector::Protocol::Runtime::InternalPropertyDescriptor&gt;&gt;::runtimeCast(WTF::move(result));
</span><del>-    if (array-&gt;length() &gt; 0)
-        *properties = array;
</del><ins>+    *properties = array-&gt;length() &gt; 0 ? array : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InjectedScript::getCollectionEntries(ErrorString&amp; errorString, const String&amp; objectId, const String&amp; objectGroup, int startIndex, int numberToFetch, RefPtr&lt;Protocol::Array&lt;Protocol::Runtime::CollectionEntry&gt;&gt;* entries)
+{
+    Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral(&quot;getCollectionEntries&quot;), inspectorEnvironment()-&gt;functionCallHandler());
+    function.appendArgument(objectId);
+    function.appendArgument(objectGroup);
+    function.appendArgument(startIndex);
+    function.appendArgument(numberToFetch);
+
+    RefPtr&lt;InspectorValue&gt; result;
+    makeCall(function, &amp;result);
+    if (!result || result-&gt;type() != InspectorValue::Type::Array) {
+        errorString = ASCIILiteral(&quot;Internal error&quot;);
+        return;
+    }
+
+    *entries = BindingTraits&lt;Array&lt;Protocol::Runtime::CollectionEntry&gt;&gt;::runtimeCast(WTF::move(result));
+}
+
</ins><span class="cx"> Ref&lt;Array&lt;Inspector::Protocol::Debugger::CallFrame&gt;&gt; InjectedScript::wrapCallFrames(const Deprecated::ScriptValue&amp; callFrames)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!hasNoValue());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScripth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScript.h (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScript.h        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScript.h        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">     void getFunctionDetails(ErrorString&amp;, const String&amp; functionId, RefPtr&lt;Protocol::Debugger::FunctionDetails&gt;* result);
</span><span class="cx">     void getProperties(ErrorString&amp;, const String&amp; objectId, bool ownProperties, bool ownAndGetterProperties, RefPtr&lt;Protocol::Array&lt;Protocol::Runtime::PropertyDescriptor&gt;&gt;* result);
</span><span class="cx">     void getInternalProperties(ErrorString&amp;, const String&amp; objectId, RefPtr&lt;Protocol::Array&lt;Protocol::Runtime::InternalPropertyDescriptor&gt;&gt;* result);
</span><ins>+    void getCollectionEntries(ErrorString&amp;, const String&amp; objectId, const String&amp; objectGroup, int startIndex, int numberToFetch, RefPtr&lt;Protocol::Array&lt;Protocol::Runtime::CollectionEntry&gt;&gt;* entries);
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;Protocol::Array&lt;Protocol::Debugger::CallFrame&gt;&gt; wrapCallFrames(const Deprecated::ScriptValue&amp;);
</span><span class="cx">     RefPtr&lt;Protocol::Runtime::RemoteObject&gt; wrapObject(const Deprecated::ScriptValue&amp;, const String&amp; groupName, bool generatePreview = false) const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> {
</span><span class="cx">     return &quot;&quot; + obj;
</span><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> function isUInt32(obj)
</span><span class="cx"> {
</span><span class="cx">     if (typeof obj === &quot;number&quot;)
</span><span class="lines">@@ -231,6 +231,27 @@
</span><span class="cx">         return descriptors;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    getCollectionEntries: function(objectId, objectGroupName, startIndex, numberToFetch)
+    {
+        var parsedObjectId = this._parseObjectId(objectId);
+        var object = this._objectForId(parsedObjectId);
+        var objectGroupName = objectGroupName || this._idToObjectGroupName[parsedObjectId.id];
+        if (!this._isDefined(object))
+            return;
+
+        if (typeof object !== &quot;object&quot;)
+            return;
+
+        var entries = this._getCollectionEntries(object, InjectedScriptHost.subtype(object), startIndex, numberToFetch);
+        
+        return entries.map(function(entry) {
+            entry.value = injectedScript._wrapObject(entry.value, objectGroupName, false, true);
+            if (&quot;key&quot; in entry)
+                entry.key = injectedScript._wrapObject(entry.key, objectGroupName, false, true);
+            return entry;
+        });
+    },
+
</ins><span class="cx">     getFunctionDetails: function(functionId)
</span><span class="cx">     {
</span><span class="cx">         var parsedFunctionId = this._parseObjectId(functionId);
</span><span class="lines">@@ -579,7 +600,7 @@
</span><span class="cx">             if (ownProperties)
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Include __proto__ at the end.
</span><span class="cx">         try {
</span><span class="cx">             if (object.__proto__)
</span><span class="lines">@@ -677,6 +698,61 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return className;
</span><ins>+    },
+
+    _getSetEntries: function(object, skip, numberToFetch)
+    {
+        var entries = [];
+
+        for (var value of object) {
+            if (skip &gt; 0) {
+                skip--;
+                continue;
+            }
+
+            entries.push({value: value});
+
+            if (numberToFetch &amp;&amp; entries.length === numberToFetch)
+                break;
+        }
+
+        return entries;
+    },
+
+    _getMapEntries: function(object, skip, numberToFetch)
+    {
+        var entries = [];
+
+        for (var [key, value] of object) {
+            if (skip &gt; 0) {
+                skip--;
+                continue;
+            }
+
+            entries.push({key: key, value: value});
+
+            if (numberToFetch &amp;&amp; entries.length === numberToFetch)
+                break;
+        }
+
+        return entries;
+    },
+
+    _getWeakMapEntries: function(object, numberToFetch)
+    {
+        return InjectedScriptHost.weakMapEntries(object, numberToFetch);
+    },
+
+    _getCollectionEntries: function(object, subtype, startIndex, numberToFetch)
+    {
+        if (subtype === &quot;set&quot;)
+            return this._getSetEntries(object, startIndex, numberToFetch);
+        if (subtype === &quot;map&quot;)
+            return this._getMapEntries(object, startIndex, numberToFetch);
+        if (subtype === &quot;weakmap&quot;)
+            return this._getWeakMapEntries(object, numberToFetch);
+
+        throw &quot;unexpected type&quot;;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -695,7 +771,7 @@
</span><span class="cx">         if (this.type !== &quot;undefined&quot;)
</span><span class="cx">             this.value = object;
</span><span class="cx"> 
</span><del>-        // Null object is object with 'null' subtype'
</del><ins>+        // Null object is object with 'null' subtype.
</ins><span class="cx">         if (object === null)
</span><span class="cx">             this.subtype = &quot;null&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -706,6 +782,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     this.objectId = injectedScript._bind(object, objectGroupName);
</span><ins>+
</ins><span class="cx">     var subtype = injectedScript._subtype(object);
</span><span class="cx">     if (subtype)
</span><span class="cx">         this.subtype = subtype;
</span><span class="lines">@@ -718,13 +795,42 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InjectedScript.RemoteObject.prototype = {
</span><ins>+    _emptyPreview: function()
+    {
+        var preview = {
+            type: this.type,
+            description: this.description || toString(this.value),
+            lossless: true,
+        };
+
+        if (this.subtype) {
+            preview.subtype = this.subtype;
+            if (this.subtype !== &quot;null&quot;) {
+                preview.overflow = false;
+                preview.properties = [];
+            }
+        }
+
+        return preview;
+    },
+
+    _createObjectPreviewForValue: function(value)
+    {
+        var remoteObject = new InjectedScript.RemoteObject(value, undefined, false, true, undefined);
+        if (remoteObject.objectId)
+            injectedScript.releaseObject(remoteObject.objectId);
+
+        return remoteObject.preview || remoteObject._emptyPreview();
+    },
+
</ins><span class="cx">     _generatePreview: function(object, firstLevelKeys, secondLevelKeys)
</span><span class="cx">     {
</span><del>-        var preview = {};
-        preview.lossless = true;
-        preview.overflow = false;
-        preview.properties = [];
</del><ins>+        var preview = this._emptyPreview();
</ins><span class="cx"> 
</span><ins>+        // Primitives just have a value.
+        if (this.type !== &quot;object&quot;)
+            return;
+
</ins><span class="cx">         var isTableRowsRequest = secondLevelKeys === null || secondLevelKeys;
</span><span class="cx">         var firstLevelKeysCount = firstLevelKeys ? firstLevelKeys.length : 0;
</span><span class="cx"> 
</span><span class="lines">@@ -734,14 +840,19 @@
</span><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">         try {
</span><del>-            // All properties.
</del><ins>+            // Maps and Sets have entries.
+            if (this.subtype === &quot;map&quot; || this.subtype === &quot;set&quot; || this.subtype === &quot;weakmap&quot;)
+                this._appendEntryPreviews(object, preview);
+
+            // Properties.
+            preview.properties = [];
</ins><span class="cx">             var descriptors = injectedScript._propertyDescriptors(object);
</span><del>-            this._appendPropertyDescriptors(preview, descriptors, propertiesThreshold, secondLevelKeys);
</del><ins>+            this._appendPropertyPreviews(preview, descriptors, propertiesThreshold, 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="cx">             // FIXME: Internal properties.
</span><del>-            // FIXME: Map/Set/Iterator entries.
</del><ins>+            // FIXME: Iterator entries.
</ins><span class="cx">         } catch (e) {
</span><span class="cx">             preview.lossless = false;
</span><span class="cx">         }
</span><span class="lines">@@ -749,7 +860,7 @@
</span><span class="cx">         return preview;
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _appendPropertyDescriptors: function(preview, descriptors, propertiesThreshold, secondLevelKeys)
</del><ins>+    _appendPropertyPreviews: function(preview, descriptors, propertiesThreshold, secondLevelKeys)
</ins><span class="cx">     {
</span><span class="cx">         for (var descriptor of descriptors) {
</span><span class="cx">             // Seen enough.
</span><span class="lines">@@ -851,6 +962,27 @@
</span><span class="cx">         preview.properties.push(property);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _appendEntryPreviews: function(object, preview)
+    {
+        // Fetch 6, but only return 5, so we can tell if we overflowed.
+        var entries = injectedScript._getCollectionEntries(object, this.subtype, 0, 6);
+        if (!entries)
+            return;
+
+        if (entries.length &gt; 5) {
+            entries.pop();
+            preview.overflow = true;
+            preview.lossless = false;
+        }
+
+        preview.entries = entries.map(function(entry) {
+            entry.value = this._createObjectPreviewForValue(entry.value);
+            if (&quot;key&quot; in entry)
+                entry.key = this._createObjectPreviewForValue(entry.key);
+            return entry;
+        }, this);
+    },
+
</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="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -30,14 +30,18 @@
</span><span class="cx"> #include &quot;Error.h&quot;
</span><span class="cx"> #include &quot;InjectedScriptHost.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><ins>+#include &quot;JSCInlines.h&quot;
</ins><span class="cx"> #include &quot;JSFunction.h&quot;
</span><span class="cx"> #include &quot;JSInjectedScriptHostPrototype.h&quot;
</span><ins>+#include &quot;JSMap.h&quot;
+#include &quot;JSSet.h&quot;
</ins><span class="cx"> #include &quot;JSTypedArrays.h&quot;
</span><ins>+#include &quot;JSWeakMap.h&quot;
</ins><span class="cx"> #include &quot;ObjectConstructor.h&quot;
</span><del>-#include &quot;JSCInlines.h&quot;
</del><span class="cx"> #include &quot;RegExpObject.h&quot;
</span><span class="cx"> #include &quot;SourceCode.h&quot;
</span><span class="cx"> #include &quot;TypedArrayInlines.h&quot;
</span><ins>+#include &quot;WeakMapData.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="lines">@@ -129,6 +133,14 @@
</span><span class="cx">         return jsNontrivialString(exec, ASCIILiteral(&quot;date&quot;));
</span><span class="cx">     if (value.inherits(RegExpObject::info()))
</span><span class="cx">         return jsNontrivialString(exec, ASCIILiteral(&quot;regexp&quot;));
</span><ins>+
+    if (value.inherits(JSMap::info()))
+        return jsNontrivialString(exec, ASCIILiteral(&quot;map&quot;));
+    if (value.inherits(JSSet::info()))
+        return jsNontrivialString(exec, ASCIILiteral(&quot;set&quot;));
+    if (value.inherits(JSWeakMap::info()))
+        return jsNontrivialString(exec, ASCIILiteral(&quot;weakmap&quot;));
+
</ins><span class="cx">     if (value.inherits(JSInt8Array::info()) || value.inherits(JSInt16Array::info()) || value.inherits(JSInt32Array::info()))
</span><span class="cx">         return jsNontrivialString(exec, ASCIILiteral(&quot;array&quot;));
</span><span class="cx">     if (value.inherits(JSUint8Array::info()) || value.inherits(JSUint16Array::info()) || value.inherits(JSUint32Array::info()))
</span><span class="lines">@@ -185,6 +197,37 @@
</span><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue JSInjectedScriptHost::weakMapEntries(ExecState* exec)
+{
+    if (exec-&gt;argumentCount() &lt; 1)
+        return jsUndefined();
+
+    JSValue value = exec-&gt;uncheckedArgument(0);
+    JSWeakMap* weakMap = jsDynamicCast&lt;JSWeakMap*&gt;(value);
+    if (!weakMap)
+        return jsUndefined();
+
+    unsigned fetched = 0;
+    unsigned numberToFetch = 100;
+
+    JSValue numberToFetchArg = exec-&gt;argument(1);
+    double fetchDouble = numberToFetchArg.toInteger(exec);
+    if (fetchDouble &gt;= 0)
+        numberToFetch = static_cast&lt;unsigned&gt;(fetchDouble);
+
+    JSArray* array = constructEmptyArray(exec, nullptr);
+    for (auto it = weakMap-&gt;weakMapData()-&gt;begin(); it != weakMap-&gt;weakMapData()-&gt;end(); ++it) {
+        JSObject* entry = constructEmptyObject(exec);
+        entry-&gt;putDirect(exec-&gt;vm(), Identifier(exec, &quot;key&quot;), it-&gt;key);
+        entry-&gt;putDirect(exec-&gt;vm(), Identifier(exec, &quot;value&quot;), it-&gt;value.get());
+        array-&gt;putDirectIndex(exec, fetched++, entry);
+        if (numberToFetch &amp;&amp; fetched &gt;= numberToFetch)
+            break;
+    }
+
+    return array;
+}
+
</ins><span class="cx"> JSValue toJS(ExecState* exec, JSGlobalObject* globalObject, InjectedScriptHost* impl)
</span><span class="cx"> {
</span><span class="cx">     if (!impl)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.h        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     JSC::JSValue subtype(JSC::ExecState*);
</span><span class="cx">     JSC::JSValue functionDetails(JSC::ExecState*);
</span><span class="cx">     JSC::JSValue getInternalProperties(JSC::ExecState*);
</span><ins>+    JSC::JSValue weakMapEntries(JSC::ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     static const unsigned StructureFlags = Base::StructureFlags;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHostPrototype.cpp        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*);
</span><ins>+static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState*);
</ins><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*);
</span><span class="cx"> 
</span><span class="lines">@@ -59,6 +60,7 @@
</span><span class="cx">     JSC_NATIVE_FUNCTION(&quot;getInternalProperties&quot;, jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(&quot;internalConstructorName&quot;, jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1);
</span><span class="cx">     JSC_NATIVE_FUNCTION(&quot;isHTMLAllCollection&quot;, jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1);
</span><ins>+    JSC_NATIVE_FUNCTION(&quot;weakMapEntries&quot;, jsInjectedScriptHostPrototypeFunctionWeakMapEntries, DontEnum, 1);
</ins><span class="cx"> 
</span><span class="cx">     Identifier evaluateIdentifier(&amp;vm, &quot;evaluate&quot;);
</span><span class="cx">     GetterSetter* accessor = GetterSetter::create(vm, globalObject);
</span><span class="lines">@@ -100,6 +102,17 @@
</span><span class="cx">     return JSValue::encode(castedThis-&gt;isHTMLAllCollection(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState* exec)
+{
+    JSValue thisValue = exec-&gt;thisValue();
+    JSInjectedScriptHost* castedThis = jsDynamicCast&lt;JSInjectedScriptHost*&gt;(thisValue);
+    if (!castedThis)
+        return throwVMTypeError(exec);
+
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info());
+    return JSValue::encode(castedThis-&gt;weakMapEntries(exec));
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionSubtype(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -178,6 +178,20 @@
</span><span class="cx">     setPauseOnExceptionsState(m_scriptDebugServer, previousPauseOnExceptionsState);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorRuntimeAgent::getCollectionEntries(ErrorString&amp; errorString, const String&amp; objectId, const String* objectGroup, const int* startIndex, const int* numberToFetch, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::CollectionEntry&gt;&gt;&amp; entries)
+{
+    InjectedScript injectedScript = m_injectedScriptManager-&gt;injectedScriptForObjectId(objectId);
+    if (injectedScript.hasNoValue()) {
+        errorString = ASCIILiteral(&quot;Inspected frame has gone&quot;);
+        return;
+    }
+
+    int start = startIndex &amp;&amp; *startIndex &gt;= 0 ? *startIndex : 0;
+    int fetch = numberToFetch &amp;&amp; *numberToFetch &gt;= 0 ? *numberToFetch : 0;
+
+    injectedScript.getCollectionEntries(errorString, objectId, objectGroup ? *objectGroup : String(), start, fetch, &amp;entries);
+}
+
</ins><span class="cx"> void InspectorRuntimeAgent::releaseObject(ErrorString&amp;, const String&amp; objectId)
</span><span class="cx"> {
</span><span class="cx">     InjectedScript injectedScript = m_injectedScriptManager-&gt;injectedScriptForObjectId(objectId);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx">     virtual void callFunctionOn(ErrorString&amp;, const String&amp; objectId, const String&amp; expression, const RefPtr&lt;Inspector::InspectorArray&gt;&amp;&amp; optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr&lt;Inspector::Protocol::Runtime::RemoteObject&gt;&amp; result, Inspector::Protocol::OptOutput&lt;bool&gt;* wasThrown) override final;
</span><span class="cx">     virtual void releaseObject(ErrorString&amp;, const ErrorString&amp; objectId) override final;
</span><span class="cx">     virtual void getProperties(ErrorString&amp;, const String&amp; objectId, const bool* ownProperties, const bool* ownAndGetterProperties, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::PropertyDescriptor&gt;&gt;&amp; result, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::InternalPropertyDescriptor&gt;&gt;&amp; internalProperties) override final;
</span><ins>+    virtual void getCollectionEntries(ErrorString&amp;, const String&amp; objectId, const String* objectGroup, const int* startIndex, const int* numberToFetch, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::CollectionEntry&gt;&gt;&amp; entries) override final;
</ins><span class="cx">     virtual void releaseObjectGroup(ErrorString&amp;, const String&amp; objectGroup) override final;
</span><span class="cx">     virtual void run(ErrorString&amp;) override;
</span><span class="cx">     virtual void getRuntimeTypesForVariablesAtOffsets(ErrorString&amp;, const RefPtr&lt;Inspector::InspectorArray&gt;&amp;&amp; locations, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::TypeDescription&gt;&gt;&amp;) override;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx">             &quot;description&quot;: &quot;Mirror object referencing original JavaScript object.&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;object&quot;, &quot;function&quot;, &quot;undefined&quot;, &quot;string&quot;, &quot;number&quot;, &quot;boolean&quot;], &quot;description&quot;: &quot;Object type.&quot; },
</span><del>-                { &quot;name&quot;: &quot;subtype&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;enum&quot;: [&quot;array&quot;, &quot;null&quot;, &quot;node&quot;, &quot;regexp&quot;, &quot;date&quot;, &quot;error&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
</del><ins>+                { &quot;name&quot;: &quot;subtype&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;enum&quot;: [&quot;array&quot;, &quot;null&quot;, &quot;node&quot;, &quot;regexp&quot;, &quot;date&quot;, &quot;error&quot;, &quot;map&quot;, &quot;set&quot;, &quot;weakmap&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;className&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Object class (constructor) name. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;value&quot;, &quot;type&quot;: &quot;any&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Remote object value (in case of primitive values or JSON values if it was requested).&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;description&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;String representation of the object.&quot; },
</span><span class="lines">@@ -26,9 +26,13 @@
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;description&quot;: &quot;Object containing abbreviated remote object value.&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><ins>+                { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;object&quot;, &quot;function&quot;, &quot;undefined&quot;, &quot;string&quot;, &quot;number&quot;, &quot;boolean&quot;], &quot;description&quot;: &quot;Object type.&quot; },
+                { &quot;name&quot;: &quot;subtype&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;enum&quot;: [&quot;array&quot;, &quot;null&quot;, &quot;node&quot;, &quot;regexp&quot;, &quot;date&quot;, &quot;error&quot;, &quot;map&quot;, &quot;set&quot;, &quot;weakmap&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
+                { &quot;name&quot;: &quot;description&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;String representation of the object.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;lossless&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;description&quot;: &quot;Determines whether preview is lossless (contains all information of the original object).&quot; },
</span><del>-                { &quot;name&quot;: &quot;overflow&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;description&quot;: &quot;True iff some of the properties of the original did not fit.&quot; },
-                { &quot;name&quot;: &quot;properties&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;PropertyPreview&quot; }, &quot;description&quot;: &quot;List of the properties.&quot; }
</del><ins>+                { &quot;name&quot;: &quot;overflow&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True iff some of the properties of the original did not fit.&quot; },
+                { &quot;name&quot;: &quot;properties&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;PropertyPreview&quot; }, &quot;optional&quot;: true, &quot;description&quot;: &quot;List of the properties.&quot; },
+                { &quot;name&quot;: &quot;entries&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;EntryPreview&quot; }, &quot;optional&quot;: true, &quot;description&quot;: &quot;List of the entries. Specified for &lt;code&gt;map&lt;/code&gt; and &lt;code&gt;set&lt;/code&gt; subtype values only.&quot; }
</ins><span class="cx">             ]
</span><span class="cx">         },
</span><span class="cx">         {
</span><span class="lines">@@ -37,12 +41,28 @@
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;name&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Property name.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;object&quot;, &quot;function&quot;, &quot;undefined&quot;, &quot;string&quot;, &quot;number&quot;, &quot;boolean&quot;, &quot;accessor&quot;], &quot;description&quot;: &quot;Object type.&quot; },
</span><del>-                { &quot;name&quot;: &quot;subtype&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;enum&quot;: [&quot;array&quot;, &quot;null&quot;, &quot;node&quot;, &quot;regexp&quot;, &quot;date&quot;, &quot;error&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
</del><ins>+                { &quot;name&quot;: &quot;subtype&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;enum&quot;: [&quot;array&quot;, &quot;null&quot;, &quot;node&quot;, &quot;regexp&quot;, &quot;date&quot;, &quot;error&quot;, &quot;map&quot;, &quot;set&quot;, &quot;weakmap&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;value&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;User-friendly property value string.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;valuePreview&quot;, &quot;$ref&quot;: &quot;ObjectPreview&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Nested value preview.&quot; }
</span><span class="cx">             ]
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;id&quot;: &quot;EntryPreview&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;key&quot;, &quot;$ref&quot;: &quot;ObjectPreview&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Entry key. Specified for map-like collection entries.&quot; },
+                { &quot;name&quot;: &quot;value&quot;, &quot;$ref&quot;: &quot;ObjectPreview&quot;, &quot;description&quot;: &quot;Entry value.&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;CollectionEntry&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;key&quot;, &quot;$ref&quot;: &quot;Runtime.RemoteObject&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Entry key of a map-like collection, otherwise not provided.&quot; },
+                { &quot;name&quot;: &quot;value&quot;, &quot;$ref&quot;: &quot;Runtime.RemoteObject&quot;, &quot;description&quot;: &quot;Entry value.&quot; }
+            ]
+        },
+        {
</ins><span class="cx">             &quot;id&quot;: &quot;PropertyDescriptor&quot;,
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;description&quot;: &quot;Object property descriptor.&quot;,
</span><span class="lines">@@ -225,6 +245,19 @@
</span><span class="cx">             &quot;description&quot;: &quot;Returns properties of a given object. Object group of the result is inherited from the target object.&quot;
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;name&quot;: &quot;getCollectionEntries&quot;,
+            &quot;description&quot;: &quot;Returns entries of given Map / Set collection.&quot;,
+            &quot;parameters&quot;: [
+                { &quot;name&quot;: &quot;objectId&quot;, &quot;$ref&quot;: &quot;Runtime.RemoteObjectId&quot;, &quot;description&quot;: &quot;Id of the collection to get entries for.&quot; },
+                { &quot;name&quot;: &quot;objectGroup&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Symbolic group name that can be used to release multiple. If not provided, it will be the same objectGroup as the RemoteObject determined from &lt;code&gt;objectId&lt;/code&gt;. This is useful for WeakMap to release the collection entries.&quot; },
+                { &quot;name&quot;: &quot;startIndex&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;If provided skip to this index before collecting values. Otherwise, 0.&quot; },
+                { &quot;name&quot;: &quot;numberToFetch&quot;, &quot;optional&quot;: true, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;If provided only return &lt;code&gt;numberToFetch&lt;/code&gt; values. Otherwise, return values all the way to the end.&quot; }
+            ],
+            &quot;returns&quot;: [
+                { &quot;name&quot;: &quot;entries&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;CollectionEntry&quot; }, &quot;description&quot;: &quot;Array of collection entries.&quot; }
+            ]
+        },
+        {
</ins><span class="cx">             &quot;name&quot;: &quot;releaseObject&quot;,
</span><span class="cx">             &quot;parameters&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;objectId&quot;, &quot;$ref&quot;: &quot;RemoteObjectId&quot;, &quot;description&quot;: &quot;Identifier of the object to release.&quot; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorscriptscodegengeneratorpy"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/inspector/scripts/codegen/generator.py        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx">     &quot;Runtime.RemoteObject&quot;,
</span><span class="cx">     &quot;Runtime.PropertyDescriptor&quot;,
</span><span class="cx">     &quot;Runtime.InternalPropertyDescriptor&quot;,
</span><ins>+    &quot;Runtime.CollectionEntry&quot;,
</ins><span class="cx">     &quot;Debugger.FunctionDetails&quot;,
</span><span class="cx">     &quot;Debugger.CallFrame&quot;,
</span><span class="cx">     &quot;Canvas.TraceLog&quot;,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakMapDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakMapData.h (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakMapData.h        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/JavaScriptCore/runtime/WeakMapData.h        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -63,6 +63,10 @@
</span><span class="cx"> 
</span><span class="cx">     static const unsigned StructureFlags = StructureIsImmortal | Base::StructureFlags;
</span><span class="cx"> 
</span><ins>+    typedef HashMap&lt;JSObject*, WriteBarrier&lt;Unknown&gt;&gt; MapType;
+    MapType::const_iterator begin() const { return m_map.begin(); }
+    MapType::const_iterator end() const { return m_map.end(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     WeakMapData(VM&amp;);
</span><span class="cx">     static void destroy(JSCell*);
</span><span class="lines">@@ -82,7 +86,6 @@
</span><span class="cx">         WeakMapData* m_target;
</span><span class="cx">     };
</span><span class="cx">     DeadKeyCleaner m_deadKeyCleaner;
</span><del>-    typedef HashMap&lt;JSObject*, WriteBarrier&lt;Unknown&gt;&gt; MapType;
</del><span class="cx">     MapType m_map;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -1,3 +1,79 @@
</span><ins>+2015-01-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Improved Console Format for Set and Map Objects (like Arrays)
+        https://bugs.webkit.org/show_bug.cgi?id=122867
+
+        Reviewed by Timothy Hatcher.
+
+        This includes Set/Map/WeakMap previews:
+
+            - Set previews: Set {1, 2, 3}
+            - Map/WeakMap previews: Map {1 =&gt; 2, &quot;key&quot; =&gt; &quot;value&quot;}
+
+        For WeakMaps:
+        
+            - the preview itself shows up to 5 key/value pairs from when the object was logged
+            - the previews are strings only, and thus do not retain the actual keys/values
+            - when expanding, we get RemoteObjects and strongly retain the keys/values
+            - when collapsing / clearing, we release the RemoteObjects so they can get collected
+
+        Currently you collapse the &lt;entries&gt; section, and re-expand later the
+        collection may show you knew keys/values. The UI for this will change.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Protocol/RemoteObject.js:
+        (WebInspector.RemoteObject.prototype.isCollectionType):
+        (WebInspector.RemoteObject.prototype.isWeakCollection):
+        (WebInspector.RemoteObject.prototype.getCollectionEntries):
+        (WebInspector.RemoteObject.prototype.releaseWeakCollectionEntries):
+        (WebInspector.RemoteObject.prototype.arrayLength):
+        (WebInspector.RemoteObject.prototype._weakCollectionObjectGroup):
+        High level functions for dealing with a RemoteObject that may be a
+        collection / weak collection.
+
+        * UserInterface/Views/ConsoleMessageImpl.js:
+        (WebInspector.ConsoleMessageImpl):
+        (WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject):
+        Include default formatters for collection types.
+
+        (WebInspector.ConsoleMessageImpl.prototype._appendPreview):
+        (WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews):
+        (WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews):
+        (WebInspector.ConsoleMessageImpl.prototype._appendValuePreview):
+        (WebInspector.ConsoleMessageImpl.prototype._appendObjectPreview): Deleted.
+        Refactor preview generation a bit and include a specific path for
+        generation the output of a preview with &quot;entries&quot;.
+
+        * UserInterface/Views/LogContentView.css:
+        (.console-object-preview-body .console-object-preview-name.console-object-preview-name-Object):
+        With nested Object previews (&quot;Map {{a:1} =&gt; 1}&quot;) don't show &quot;Object&quot; for the inner
+        object preview. Only show it if it has a unique type (&quot;Map {Foo {a:1} =&gt; 1}&quot;)
+
+        (.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap):
+        (:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .section):
+        (:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .properties):
+        Make map/set/weakmap display like Objects.
+
+        * UserInterface/Views/ObjectPropertiesSection.js:
+        (WebInspector.ObjectPropertiesSection.prototype.update):
+        (WebInspector.ObjectPropertiesSection.prototype.updateProperties):
+        (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate.callback):
+        (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
+        (WebInspector.CollectionEntriesMainTreeElement):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype.oncollapse):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype.ondetach):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype._trackWeakEntries):
+        (WebInspector.CollectionEntriesMainTreeElement.prototype._untrackWeakEntries):
+        (WebInspector.CollectionEntryTreeElement):
+        (WebInspector.CollectionEntryTreeElement.prototype.onpopulate):
+        (WebInspector.CollectionEntryTreeElement.prototype.onattach):
+        (WebInspector.EmptyCollectionTreeElement):
+        (WebInspector.ObjectPropertiesSection.prototype.update.callback): Deleted.
+        Add a quick UI for exploring the entries of a collection. We are actively
+        changing the styles of objects in the Console, so this should change soon.
+
</ins><span class="cx"> 2015-01-28  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Change Main Frame Status Buttons when debugging Augmented JSContext
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx"> localizedStrings[&quot;Element is masked and composited descendants&quot;] = &quot;Element is masked and composited descendants&quot;;
</span><span class="cx"> localizedStrings[&quot;Element is the root element&quot;] = &quot;Element is the root element&quot;;
</span><span class="cx"> localizedStrings[&quot;Element overlaps other compositing element&quot;] = &quot;Element overlaps other compositing element&quot;;
</span><ins>+localizedStrings[&quot;Empty Collection&quot;] = &quot;Empty Collection&quot;;
</ins><span class="cx"> localizedStrings[&quot;Enable Breakpoint&quot;] = &quot;Enable Breakpoint&quot;;
</span><span class="cx"> localizedStrings[&quot;Enable Breakpoints&quot;] = &quot;Enable Breakpoints&quot;;
</span><span class="cx"> localizedStrings[&quot;Enable all breakpoints&quot;] = &quot;Enable all breakpoints&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -223,6 +223,42 @@
</span><span class="cx">         }
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    isCollectionType: function()
+    {
+        return this.subtype === &quot;map&quot; || this.subtype === &quot;set&quot; || this.subtype === &quot;weakmap&quot;;
+    },
+
+    isWeakCollection: function()
+    {
+        return this.subtype === &quot;weakmap&quot;;
+    },
+
+    getCollectionEntries: function(start, numberToFetch, callback)
+    {
+        start = typeof start === &quot;number&quot; ? start : 0;
+        numberToFetch = typeof numberToFetch === &quot;number&quot; ? numberToFetch : 100;
+
+        console.assert(start &gt;= 0);
+        console.assert(numberToFetch &gt;= 0);
+        console.assert(this.isCollectionType());
+
+        // WeakMaps are not ordered. We should never send a non-zero start.
+        console.assert((this.subtype === &quot;weakmap&quot; &amp;&amp; start === 0) || this.subtype !== &quot;weakmap&quot;);
+
+        var objectGroup = this.isWeakCollection() ? this._weakCollectionObjectGroup() : &quot;&quot;;
+
+        RuntimeAgent.getCollectionEntries(this._objectId, objectGroup, start, numberToFetch, function(error, entries) {
+            callback(entries);
+        });
+    },
+
+    releaseWeakCollectionEntries: function()
+    {
+        console.assert(this.isWeakCollection());
+
+        RuntimeAgent.releaseObjectGroup(this._weakCollectionObjectGroup());
+    },
+
</ins><span class="cx">     pushNodeToFrontend: function(callback)
</span><span class="cx">     {
</span><span class="cx">         if (this._objectId)
</span><span class="lines">@@ -265,6 +301,13 @@
</span><span class="cx">         if (!matches)
</span><span class="cx">             return 0;
</span><span class="cx">         return parseInt(matches[1], 10);
</span><ins>+    },
+
+    // Private
+
+    _weakCollectionObjectGroup: function()
+    {
+        return JSON.stringify(this._objectId) + &quot;-WeakMap&quot;;
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsConsoleMessageImpljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageImpl.js        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx">     this._customFormatters = {
</span><span class="cx">         &quot;object&quot;: this._formatParameterAsObject,
</span><span class="cx">         &quot;error&quot;: this._formatParameterAsObject,
</span><ins>+        &quot;map&quot;: this._formatParameterAsObject,
+        &quot;set&quot;: this._formatParameterAsObject,
+        &quot;weakmap&quot;: this._formatParameterAsObject,
</ins><span class="cx">         &quot;array&quot;:  this._formatParameterAsArray,
</span><span class="cx">         &quot;node&quot;:   this._formatParameterAsNode,
</span><span class="cx">         &quot;string&quot;: this._formatParameterAsString
</span><span class="lines">@@ -276,7 +279,17 @@
</span><span class="cx">         var titleElement = document.createElement(&quot;span&quot;);
</span><span class="cx">         if (includePreview &amp;&amp; obj.preview) {
</span><span class="cx">             titleElement.classList.add(&quot;console-object-preview&quot;);
</span><del>-            var lossless = this._appendObjectPreview(titleElement, obj);
</del><ins>+
+            // COMPATIBILITY (iOS 8): iOS 7 and 8 did not have type/subtype/description on
+            // Runtime.ObjectPreview. Copy them over from the RemoteObject.
+            var preview = obj.preview;
+            if (!preview.type) {
+                preview.type = obj.type;
+                preview.subtype = obj.subtype;
+                preview.description = obj.description;
+            }
+
+            var lossless = this._appendPreview(titleElement, preview);
</ins><span class="cx">             if (lossless) {
</span><span class="cx">                 titleElement.classList.add(&quot;console-object-preview-lossless&quot;);
</span><span class="cx">                 elem.appendChild(titleElement);
</span><span class="lines">@@ -289,23 +302,58 @@
</span><span class="cx">         elem.appendChild(section.element);
</span><span class="cx">     },
</span><span class="cx"> 
</span><del>-    _appendObjectPreview: function(titleElement, obj)
</del><ins>+    _appendPreview: function(element, preview)
</ins><span class="cx">     {
</span><del>-        var preview = obj.preview;
-        var isArray = obj.subtype === &quot;array&quot;;
-
-        if (obj.description &amp;&amp; !isArray) {
</del><ins>+        if (preview.type === &quot;object&quot; &amp;&amp; preview.subtype !== &quot;null&quot; &amp;&amp; preview.subtype !== &quot;array&quot;) {
</ins><span class="cx">             var previewObjectNameElement = document.createElement(&quot;span&quot;);
</span><span class="cx">             previewObjectNameElement.classList.add(&quot;console-object-preview-name&quot;);
</span><del>-            if (obj.description === &quot;Object&quot;)
</del><ins>+            if (preview.description === &quot;Object&quot;)
</ins><span class="cx">                 previewObjectNameElement.classList.add(&quot;console-object-preview-name-Object&quot;);
</span><span class="cx"> 
</span><del>-            previewObjectNameElement.textContent = obj.description + &quot; &quot;;
-            titleElement.appendChild(previewObjectNameElement);
</del><ins>+            previewObjectNameElement.textContent = preview.description + &quot; &quot;;
+            element.appendChild(previewObjectNameElement);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        var bodyElement = titleElement.createChild(&quot;span&quot;, &quot;console-object-preview-body&quot;);
-        bodyElement.appendChild(document.createTextNode(isArray ? &quot;[&quot; : &quot;{&quot;));
</del><ins>+        var bodyElement = element.createChild(&quot;span&quot;, &quot;console-object-preview-body&quot;);
+        if (preview.entries)
+            return this._appendEntryPreviews(bodyElement, preview);
+        if (preview.properties)
+            return this._appendPropertyPreviews(bodyElement, preview);
+        return this._appendValuePreview(bodyElement, preview);
+    },
+
+    _appendEntryPreviews: function(element, preview)
+    {
+        var lossless = preview.lossless &amp;&amp; !preview.properties.length;
+
+        element.appendChild(document.createTextNode(&quot;{&quot;));
+
+        for (var i = 0; i &lt; preview.entries.length; ++i) {
+            if (i &gt; 0)
+                element.appendChild(document.createTextNode(&quot;, &quot;));
+
+            var entry = preview.entries[i];
+            if (entry.key) {
+                this._appendPreview(element, entry.key);
+                element.appendChild(document.createTextNode(&quot; =&gt; &quot;));
+            }
+
+            this._appendPreview(element, entry.value);
+        }
+
+        if (preview.overflow)
+            element.createChild(&quot;span&quot;).textContent = &quot;\u2026&quot;;
+        element.appendChild(document.createTextNode(&quot;}&quot;));
+
+        return lossless;
+    },
+
+    _appendPropertyPreviews: function(element, preview)
+    {
+        var isArray = preview.subtype === &quot;array&quot;;
+
+        element.appendChild(document.createTextNode(isArray ? &quot;[&quot; : &quot;{&quot;));
+
</ins><span class="cx">         for (var i = 0; i &lt; preview.properties.length; ++i) {
</span><span class="cx">             var property = preview.properties[i];
</span><span class="cx"> 
</span><span class="lines">@@ -318,14 +366,14 @@
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="cx">             if (i &gt; 0)
</span><del>-                bodyElement.appendChild(document.createTextNode(&quot;, &quot;));
</del><ins>+                element.appendChild(document.createTextNode(&quot;, &quot;));
</ins><span class="cx">     
</span><span class="cx">             if (!isArray || property.name != i) {
</span><del>-                bodyElement.createChild(&quot;span&quot;, &quot;name&quot;).textContent = property.name;
-                bodyElement.appendChild(document.createTextNode(&quot;: &quot;));
</del><ins>+                element.createChild(&quot;span&quot;, &quot;name&quot;).textContent = property.name;
+                element.appendChild(document.createTextNode(&quot;: &quot;));
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            var span = bodyElement.createChild(&quot;span&quot;, &quot;console-formatted-&quot; + property.type);
</del><ins>+            var span = element.createChild(&quot;span&quot;, &quot;console-formatted-&quot; + property.type);
</ins><span class="cx">             if (property.type === &quot;object&quot;) {
</span><span class="cx">                 if (property.subtype === &quot;node&quot;)
</span><span class="cx">                     span.classList.add(&quot;console-formatted-preview-node&quot;);
</span><span class="lines">@@ -340,12 +388,20 @@
</span><span class="cx">             else
</span><span class="cx">                 span.textContent = property.value;
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         if (preview.overflow)
</span><del>-            bodyElement.createChild(&quot;span&quot;).textContent = &quot;\u2026&quot;;
-        bodyElement.appendChild(document.createTextNode(isArray ? &quot;]&quot; : &quot;}&quot;));
</del><ins>+            element.createChild(&quot;span&quot;).textContent = &quot;\u2026&quot;;
+
+        element.appendChild(document.createTextNode(isArray ? &quot;]&quot; : &quot;}&quot;));
+
</ins><span class="cx">         return preview.lossless;
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _appendValuePreview: function(element, preview)
+    {
+        element.appendChild(document.createTextNode(preview.description));
+    },
+
</ins><span class="cx">     _formatParameterAsNode: function(object, elem)
</span><span class="cx">     {
</span><span class="cx">         function printNode(nodeId)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLogContentViewcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.css        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -290,22 +290,26 @@
</span><span class="cx">     display: none;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+.console-object-preview-body .console-object-preview-name.console-object-preview-name-Object { 
+    display: none;
+}
+
</ins><span class="cx"> .expanded .console-object-preview &gt; .console-object-preview-name.console-object-preview-name-Object {
</span><span class="cx">     display: inline;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.console-formatted-object, .console-formatted-node, .console-formatted-error {
</del><ins>+.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap {
</ins><span class="cx">     position: relative;
</span><span class="cx">     display: inline-block;
</span><span class="cx">     vertical-align: top;
</span><span class="cx">     color: black;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.console-formatted-object .section, .console-formatted-node .section, .console-formatted-error .section {
</del><ins>+:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .section {
</ins><span class="cx">     position: static;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.console-formatted-object .properties, .console-formatted-node .properties, .console-formatted-error .properties {
</del><ins>+:matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .properties {
</ins><span class="cx">     padding-left: 0 !important;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js (179348 => 179349)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js        2015-01-29 19:20:06 UTC (rev 179348)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js        2015-01-29 19:25:16 UTC (rev 179349)
</span><span class="lines">@@ -43,17 +43,18 @@
</span><span class="cx"> 
</span><span class="cx">     update: function()
</span><span class="cx">     {
</span><del>-        var self = this;
</del><span class="cx">         function callback(properties)
</span><span class="cx">         {
</span><span class="cx">             if (!properties)
</span><span class="cx">                 return;
</span><del>-            self.updateProperties(properties);
</del><ins>+
+            this.updateProperties(properties);
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">         if (this.getAllProperties)
</span><del>-            this.object.getAllProperties(callback);
</del><ins>+            this.object.getAllProperties(callback.bind(this));
</ins><span class="cx">         else
</span><del>-            this.object.getOwnAndGetterProperties(callback);
</del><ins>+            this.object.getOwnAndGetterProperties(callback.bind(this));
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
</span><span class="lines">@@ -86,6 +87,9 @@
</span><span class="cx">         }
</span><span class="cx">         this.propertiesForTest = properties;
</span><span class="cx"> 
</span><ins>+        if (this.object.isCollectionType())
+            this.propertiesTreeOutline.appendChild(new WebInspector.CollectionEntriesMainTreeElement(this.object));
+
</ins><span class="cx">         this.dispatchEventToListeners(WebInspector.Section.Event.VisibleContentDidChange);
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="lines">@@ -153,15 +157,17 @@
</span><span class="cx">         if (this.children.length &amp;&amp; !this.shouldRefreshChildren)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        var callback = function(properties) {
</del><ins>+        function callback(properties) {
</ins><span class="cx">             this.removeChildren();
</span><span class="cx">             if (!properties)
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">             properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);
</span><del>-            for (var i = 0; i &lt; properties.length; ++i) {
</del><ins>+            for (var i = 0; i &lt; properties.length; ++i)
</ins><span class="cx">                 this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
</span><del>-            }
</del><ins>+
+            if (this.property.value.isCollectionType())
+                this.appendChild(new WebInspector.CollectionEntriesMainTreeElement(this.property.value));
</ins><span class="cx">         };
</span><span class="cx"> 
</span><span class="cx">         if (this.property.name === &quot;__proto__&quot;)
</span><span class="lines">@@ -345,3 +351,188 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototype;
</span><ins>+
+WebInspector.CollectionEntriesMainTreeElement = function(remoteObject)
+{
+    TreeElement.call(this, &quot;&lt;entries&gt;&quot;, null, false);
+
+    console.assert(remoteObject);
+
+    this._remoteObject = remoteObject;
+    this._requestingEntries = false;
+    this._trackingEntries = false;
+
+    this.toggleOnClick = true;
+    this.selectable = false;
+    this.hasChildren = true;
+    this.expand();
+
+    // FIXME: When a parent TreeElement is collapsed, we do not get a chance
+    // to releaseWeakCollectionEntries. We should.
+}
+
+WebInspector.CollectionEntriesMainTreeElement.prototype = {
+    constructor: WebInspector.CollectionEntriesMainTreeElement,
+    __proto__: TreeElement.prototype,
+
+    onexpand: function()
+    {
+        if (this.children.length &amp;&amp; !this.shouldRefreshChildren)
+            return;
+
+        if (this._requestingEntries)
+            return;
+
+        this._requestingEntries = true;
+
+        function callback(entries) {
+            this._requestingEntries = false;
+
+            this.removeChildren();
+
+            if (!entries || !entries.length) {
+                this.appendChild(new WebInspector.EmptyCollectionTreeElement);
+                return;
+            }
+
+            this._trackWeakEntries();
+
+            for (var i = 0; i &lt; entries.length; ++i) {
+                var entry = entries[i];
+                if (entry.key)
+                    this.appendChild(new WebInspector.CollectionEntryTreeElement(entry, i));
+                else {
+                    this.appendChild(new WebInspector.ObjectPropertyTreeElement({
+                        name: &quot;&quot; + i,
+                        value: WebInspector.RemoteObject.fromPayload(entry.value),
+                        enumerable: true,
+                        writable: false,
+                    }));
+                }
+            }
+        }
+        
+        this._remoteObject.getCollectionEntries(0, 100, callback.bind(this));
+    },
+
+    oncollapse: function()
+    {
+        this._untrackWeakEntries();
+    },
+
+    ondetach: function()
+    {
+        this._untrackWeakEntries();
+    },
+
+    // Private.
+
+    _trackWeakEntries: function()
+    {
+        if (!this._remoteObject.isWeakCollection())
+            return;
+
+        if (this._trackingEntries)
+            return;
+
+        this._trackingEntries = true;
+
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.Cleared, this._untrackWeakEntries, this);
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._untrackWeakEntries, this);
+        WebInspector.logManager.addEventListener(WebInspector.LogManager.Event.SessionStarted, this._untrackWeakEntries, this);
+    },
+
+    _untrackWeakEntries: function()
+    {
+        if (!this._remoteObject.isWeakCollection())
+            return;
+
+        if (!this._trackingEntries)
+            return;
+
+        this._trackingEntries = false;
+
+        this._remoteObject.releaseWeakCollectionEntries();
+
+        WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.Cleared, this._untrackWeakEntries, this);
+        WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.ActiveLogCleared, this._untrackWeakEntries, this);
+        WebInspector.logManager.removeEventListener(WebInspector.LogManager.Event.SessionStarted, this._untrackWeakEntries, this);
+
+        this.removeChildren();
+
+        if (this.expanded)
+            this.collapse();
+    },
+}
+
+WebInspector.CollectionEntryTreeElement = function(entry, index)
+{
+    TreeElement.call(this, &quot;&quot;, null, false);
+
+    console.assert(entry);
+
+    this._name = &quot;&quot; + index;
+    this._key = WebInspector.RemoteObject.fromPayload(entry.key);
+    this._value = WebInspector.RemoteObject.fromPayload(entry.value);
+
+    this.toggleOnClick = true;
+    this.selectable = false;
+    this.hasChildren = true;
+}
+
+WebInspector.CollectionEntryTreeElement.prototype = {
+    constructor: WebInspector.CollectionEntryTreeElement,
+    __proto__: TreeElement.prototype,
+
+    onpopulate: function()
+    {
+        if (this.children.length &amp;&amp; !this.shouldRefreshChildren)
+            return;
+
+        this.appendChild(new WebInspector.ObjectPropertyTreeElement({
+            name: &quot;key&quot;,
+            value: this._key,
+            enumerable: true,
+            writable: false,
+        }));
+
+        this.appendChild(new WebInspector.ObjectPropertyTreeElement({
+            name: &quot;value&quot;,
+            value: this._value,
+            enumerable: true,
+            writable: false,
+        }));
+    },
+
+    onattach: function()
+    {
+        var nameElement = document.createElement(&quot;span&quot;);
+        nameElement.className = &quot;name&quot;;
+        nameElement.textContent = &quot;&quot; + this._name;
+
+        var separatorElement = document.createElement(&quot;span&quot;);
+        separatorElement.className = &quot;separator&quot;;
+        separatorElement.textContent = &quot;: &quot;;
+
+        var valueElement = document.createElement(&quot;span&quot;);
+        valueElement.className = &quot;value&quot;;
+        valueElement.textContent = &quot;{&quot; + this._key.description + &quot; =&gt; &quot; + this._value.description + &quot;}&quot;;
+
+        this.listItemElement.removeChildren();
+        this.listItemElement.appendChild(nameElement);
+        this.listItemElement.appendChild(separatorElement);
+        this.listItemElement.appendChild(valueElement);
+    }
+}
+
+WebInspector.EmptyCollectionTreeElement = function()
+{
+    TreeElement.call(this, WebInspector.UIString(&quot;Empty Collection&quot;), null, false);
+
+    this.selectable = false;
+}
+
+WebInspector.EmptyCollectionTreeElement.prototype = {
+    constructor: WebInspector.EmptyCollectionTreeElement,
+    __proto__: TreeElement.prototype
+}
</ins></span></pre>
</div>
</div>

</body>
</html>