<!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>[182047] 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/182047">182047</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-26 18:42:37 -0700 (Thu, 26 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: ES6: Provide a better view for Classes in the console
https://bugs.webkit.org/show_bug.cgi?id=142999

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Runtime.json:
Provide a new `subtype` enum &quot;class&quot;. This is a subtype of `type`
&quot;function&quot;, all other subtypes are subtypes of `object` types.
For a class, the frontend will immediately want to get the prototype
to enumerate its methods, so include the `classPrototype`.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Denote class construction functions as &quot;class&quot; subtypes.

* inspector/InjectedScriptSource.js:
Handling for the new &quot;class&quot; type.

* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedFunctionExecutable::isClassConstructorFunction):
* runtime/Executable.h:
(JSC::FunctionExecutable::isClassConstructorFunction):
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::isClassConstructorFunction):
Check if this function is a class constructor function. That information
is on the UnlinkedFunctionExecutable, so plumb it through to JSFunction.

Source/WebInspectorUI:

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPrimitiveValue):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.prototype.get classPrototype):
(WebInspector.RemoteObject.prototype.isClass):
Update our RemoteObject model object for the new subtype
and its unique properties.

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForTypesAndValue):
(WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject):
Better handle &quot;class&quot;, as it is a new function subtype.

* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl):
(WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsObject):
Format a &quot;class&quot; with ObjectTreeView.

* UserInterface/Views/ObjectTreeArrayIndexTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .getter.disabled):
(.object-tree-property .getter:not(.disabled):hover):
(.object-tree-property .getter:hover): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
In ClassAPI mode, you cannot invoke a getter since we don't have
an instance to invoke it on. So disable interactivity with getters.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView):
Update the modes to include an API mode for instances and classes.

(WebInspector.ObjectTreeView.defaultModeForObject):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
Simplify ObjectTree construction to automatically determine mode based
on the RemoteObject that was provided.

* Localizations/en.lproj/localizedStrings.js:
&quot;Getter&quot; tooltip.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Update the test to include coverage of the new &quot;class&quot; subtype of &quot;function&quot;.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjecthtml">trunk/LayoutTests/inspector/model/remote-object.html</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh">trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.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="#trunkSourceJavaScriptCoreinspectorprotocolRuntimejson">trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutableh">trunk/Source/JavaScriptCore/runtime/Executable.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctionh">trunk/Source/JavaScriptCore/runtime/JSFunction.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctionInlinesh">trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.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="#trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs">trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessageImpljs">trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeArrayIndexTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeArrayIndexTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeBaseTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementcss">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs">trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/LayoutTests/ChangeLog        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-03-26  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Provide a better view for Classes in the console
+        https://bugs.webkit.org/show_bug.cgi?id=142999
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+        Update the test to include coverage of the new &quot;class&quot; subtype of &quot;function&quot;.
+
</ins><span class="cx"> 2015-03-26  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;function&quot;,
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><del>-  &quot;_description&quot;: &quot;function () {}&quot;
</del><ins>+  &quot;_description&quot;: &quot;function (){}&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;function&quot;,
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><del>-  &quot;_description&quot;: &quot;function foo() {}&quot;
</del><ins>+  &quot;_description&quot;: &quot;function foo(){}&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;function&quot;,
</span><span class="cx">   &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
</span><del>-  &quot;_description&quot;: &quot;function () { return 1; }&quot;
</del><ins>+  &quot;_description&quot;: &quot;function () { return 1 }&quot;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><span class="lines">@@ -4092,6 +4092,69 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> -----------------------------------------------------
</span><ins>+EXPRESSION: Person = class Person { constructor(){} get fullName(){} methodName(p1, p2){} }; Person
+{
+  &quot;_type&quot;: &quot;function&quot;,
+  &quot;_subtype&quot;: &quot;class&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;class Person&quot;,
+  &quot;_classPrototype&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+    &quot;_description&quot;: &quot;Person&quot;
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: Person.prototype.methodName
+{
+  &quot;_type&quot;: &quot;function&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;function methodName(p1, p2){}&quot;
+}
+
+-----------------------------------------------------
+EXPRESSION: Alpha = class A { methodA(){} }; Beta = class B extends Alpha { methodB(){} }; Beta
+{
+  &quot;_type&quot;: &quot;function&quot;,
+  &quot;_subtype&quot;: &quot;class&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;class B&quot;,
+  &quot;_classPrototype&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+    &quot;_description&quot;: &quot;B&quot;
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: [Beta]
+{
+  &quot;_type&quot;: &quot;object&quot;,
+  &quot;_subtype&quot;: &quot;array&quot;,
+  &quot;_objectId&quot;: &quot;&lt;filtered&gt;&quot;,
+  &quot;_description&quot;: &quot;Array&quot;,
+  &quot;_size&quot;: 1,
+  &quot;_preview&quot;: {
+    &quot;_type&quot;: &quot;object&quot;,
+    &quot;_subtype&quot;: &quot;array&quot;,
+    &quot;_description&quot;: &quot;Array&quot;,
+    &quot;_lossless&quot;: false,
+    &quot;_overflow&quot;: false,
+    &quot;_size&quot;: 1,
+    &quot;_properties&quot;: [
+      {
+        &quot;_name&quot;: &quot;0&quot;,
+        &quot;_type&quot;: &quot;function&quot;,
+        &quot;_subtype&quot;: &quot;class&quot;,
+        &quot;_value&quot;: &quot;B&quot;
+      }
+    ],
+    &quot;_entries&quot;: null
+  }
+}
+
+-----------------------------------------------------
</ins><span class="cx"> EXPRESSION: Object.seal({})
</span><span class="cx"> {
</span><span class="cx">   &quot;_type&quot;: &quot;object&quot;,
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjecthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object.html (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object.html        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/LayoutTests/inspector/model/remote-object.html        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -154,6 +154,13 @@
</span><span class="cx">         {expression: &quot;Promise.resolve()&quot;},
</span><span class="cx">         {expression: &quot;Promise.resolve({result:1})&quot;},
</span><span class="cx"> 
</span><ins>+    // Classes
+
+        {expression: &quot;Person = class Person { constructor(){} get fullName(){} methodName(p1, p2){} }; Person&quot;}, // Constructor =&gt; class type
+        {expression: &quot;Person.prototype.methodName&quot;}, // Method =&gt; just a function type
+        {expression: &quot;Alpha = class A { methodA(){} }; Beta = class B extends Alpha { methodB(){} }; Beta&quot;},
+        {expression: &quot;[Beta]&quot;},
+
</ins><span class="cx">     // Improveable:
</span><span class="cx"> 
</span><span class="cx">         // Sealed / Frozen objects.
</span><span class="lines">@@ -216,7 +223,11 @@
</span><span class="cx"> 
</span><span class="cx">     for (var step of steps) {
</span><span class="cx">         console.info(&quot;EXPRESSION&quot;, step.expression);
</span><del>-        console.log(eval(step.expression));
</del><ins>+        try {
+            console.log(eval(step.expression));
+        } catch (e) {
+            console.log(&quot;EXCEPTION: &quot; + e);
+        }
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-03-26  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Provide a better view for Classes in the console
+        https://bugs.webkit.org/show_bug.cgi?id=142999
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/protocol/Runtime.json:
+        Provide a new `subtype` enum &quot;class&quot;. This is a subtype of `type`
+        &quot;function&quot;, all other subtypes are subtypes of `object` types.
+        For a class, the frontend will immediately want to get the prototype
+        to enumerate its methods, so include the `classPrototype`.
+
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::subtype):
+        Denote class construction functions as &quot;class&quot; subtypes.
+
+        * inspector/InjectedScriptSource.js:
+        Handling for the new &quot;class&quot; type.
+
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedFunctionExecutable::isClassConstructorFunction):
+        * runtime/Executable.h:
+        (JSC::FunctionExecutable::isClassConstructorFunction):
+        * runtime/JSFunction.h:
+        * runtime/JSFunctionInlines.h:
+        (JSC::JSFunction::isClassConstructorFunction):
+        Check if this function is a class constructor function. That information
+        is on the UnlinkedFunctionExecutable, so plumb it through to JSFunction.
+
</ins><span class="cx"> 2015-03-26  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Function.prototype.toString should not decompile the AST
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -166,6 +166,7 @@
</span><span class="cx">     static void destroy(JSCell*);
</span><span class="cx"> 
</span><span class="cx">     bool isBuiltinFunction() const { return m_isBuiltinFunction; }
</span><ins>+    bool isClassConstructorFunction() const { return constructorKind() != ConstructorKind::None; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UnlinkedFunctionExecutable(VM*, Structure*, const SourceCode&amp;, RefPtr&lt;SourceProvider&gt;&amp;&amp; sourceOverride, FunctionBodyNode*, UnlinkedFunctionKind);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -779,6 +779,9 @@
</span><span class="cx">         if (subtype === &quot;array&quot;)
</span><span class="cx">             return className;
</span><span class="cx"> 
</span><ins>+        if (subtype === &quot;class&quot;)
+            return obj.name;
+
</ins><span class="cx">         // NodeList in JSC is a function, check for array prior to this.
</span><span class="cx">         if (typeof obj === &quot;function&quot;)
</span><span class="cx">             return toString(obj);
</span><span class="lines">@@ -922,6 +925,8 @@
</span><span class="cx">         this.size = object.size;
</span><span class="cx">     else if (subtype === &quot;weakmap&quot;)
</span><span class="cx">         this.size = InjectedScriptHost.weakMapSize(object);
</span><ins>+    else if (subtype === &quot;class&quot;)
+        this.classPrototype = injectedScript._wrapObject(object.prototype, objectGroupName);
</ins><span class="cx"> 
</span><span class="cx">     if (generatePreview &amp;&amp; this.type === &quot;object&quot;)
</span><span class="cx">         this.preview = this._generatePreview(object, undefined, columnNames);
</span><span class="lines">@@ -955,6 +960,8 @@
</span><span class="cx">         var remoteObject = new InjectedScript.RemoteObject(value, undefined, false, true, undefined);
</span><span class="cx">         if (remoteObject.objectId)
</span><span class="cx">             injectedScript.releaseObject(remoteObject.objectId);
</span><ins>+        if (remoteObject.classPrototype &amp;&amp; remoteObject.classPrototype.objectId)
+            injectedScript.releaseObject(remoteObject.classPrototype.objectId);
</ins><span class="cx"> 
</span><span class="cx">         return remoteObject.preview || remoteObject._emptyPreview();
</span><span class="cx">     },
</span><span class="lines">@@ -1103,7 +1110,7 @@
</span><span class="cx">                     preview.overflow = true;
</span><span class="cx">             } else {
</span><span class="cx">                 var description = &quot;&quot;;
</span><del>-                if (type !== &quot;function&quot;)
</del><ins>+                if (type !== &quot;function&quot; || subtype === &quot;class&quot;)
</ins><span class="cx">                     description = this._abbreviateString(injectedScript._describe(value), maxLength, subtype === &quot;regexp&quot;);
</span><span class="cx">                 property.value = description;
</span><span class="cx">                 preview.lossless = false;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -136,9 +136,16 @@
</span><span class="cx">         return exec-&gt;vm().smallStrings.symbolString();
</span><span class="cx"> 
</span><span class="cx">     JSObject* object = asObject(value);
</span><del>-    if (object &amp;&amp; object-&gt;isErrorInstance())
-        return jsNontrivialString(exec, ASCIILiteral(&quot;error&quot;));
</del><ins>+    if (object) {
+        if (object-&gt;isErrorInstance())
+            return jsNontrivialString(exec, ASCIILiteral(&quot;error&quot;));
</ins><span class="cx"> 
</span><ins>+        // Consider class constructor functions class objects.
+        JSFunction* function = jsDynamicCast&lt;JSFunction*&gt;(value);
+        if (function &amp;&amp; function-&gt;isClassConstructorFunction())
+            return jsNontrivialString(exec, ASCIILiteral(&quot;class&quot;));
+    }
+
</ins><span class="cx">     if (value.inherits(JSArray::info()))
</span><span class="cx">         return jsNontrivialString(exec, ASCIILiteral(&quot;array&quot;));
</span><span class="cx">     if (value.inherits(DateInstance::info()))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -13,12 +13,13 @@
</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;symbol&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;map&quot;, &quot;set&quot;, &quot;weakmap&quot;, &quot;iterator&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;iterator&quot;, &quot;class&quot;], &quot;description&quot;: &quot;Object subtype hint. Specified for &lt;code&gt;object&lt;/code&gt; &lt;code&gt;function&lt;/code&gt; (for class) 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="cx">                 { &quot;name&quot;: &quot;objectId&quot;, &quot;$ref&quot;: &quot;RemoteObjectId&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Unique object identifier (for non-primitive values).&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;size&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Size of the array/collection. Specified for array/map/set/weakmap object type values only.&quot; },
</span><ins>+                { &quot;name&quot;: &quot;classPrototype&quot;, &quot;$ref&quot;: &quot;RemoteObject&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Remote object for the class prototype. Specified for class object type values only.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;preview&quot;, &quot;$ref&quot;: &quot;ObjectPreview&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Preview containing abbreviated property values. Specified for &lt;code&gt;object&lt;/code&gt; type values only.&quot; }
</span><span class="cx">             ]
</span><span class="cx">         },
</span><span class="lines">@@ -28,7 +29,7 @@
</span><span class="cx">             &quot;description&quot;: &quot;Object containing abbreviated remote object value.&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;symbol&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;map&quot;, &quot;set&quot;, &quot;weakmap&quot;, &quot;iterator&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;iterator&quot;, &quot;class&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;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="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><span class="cx">                 { &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; },
</span><span class="lines">@@ -43,7 +44,7 @@
</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;symbol&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;map&quot;, &quot;set&quot;, &quot;weakmap&quot;, &quot;iterator&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;iterator&quot;, &quot;class&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">                 { &quot;name&quot;: &quot;internal&quot;, &quot;type&quot;: &quot;boolean&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;True if this is an internal property.&quot; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.h (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.h        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/runtime/Executable.h        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -627,6 +627,7 @@
</span><span class="cx">         
</span><span class="cx">     FunctionMode functionMode() { return m_unlinkedExecutable-&gt;functionMode(); }
</span><span class="cx">     bool isBuiltinFunction() const { return m_unlinkedExecutable-&gt;isBuiltinFunction(); }
</span><ins>+    bool isClassConstructorFunction() const { return m_unlinkedExecutable-&gt;isClassConstructorFunction(); }
</ins><span class="cx">     const Identifier&amp; name() { return m_unlinkedExecutable-&gt;name(); }
</span><span class="cx">     const Identifier&amp; inferredName() { return m_unlinkedExecutable-&gt;inferredName(); }
</span><span class="cx">     JSString* nameValue() const { return m_unlinkedExecutable-&gt;nameValue(); }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.h (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.h        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.h        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx">     bool isHostOrBuiltinFunction() const;
</span><span class="cx">     bool isBuiltinFunction() const;
</span><span class="cx">     JS_EXPORT_PRIVATE bool isHostFunctionNonInline() const;
</span><ins>+    bool isClassConstructorFunction() const;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     const static unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | OverridesGetPropertyNames | JSObject::StructureFlags;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctionInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.h (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.h        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/JavaScriptCore/runtime/JSFunctionInlines.h        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -60,6 +60,11 @@
</span><span class="cx">     return isHostFunction() || isBuiltinFunction();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline bool JSFunction::isClassConstructorFunction() const
+{
+    return !isHostFunction() &amp;&amp; jsExecutable()-&gt;isClassConstructorFunction();
+}
+
</ins><span class="cx"> inline NativeFunction JSFunction::nativeFunction()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isHostFunctionNonInline());
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-03-26  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: ES6: Provide a better view for Classes in the console
+        https://bugs.webkit.org/show_bug.cgi?id=142999
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Protocol/RemoteObject.js:
+        (WebInspector.RemoteObject):
+        (WebInspector.RemoteObject.fromPrimitiveValue):
+        (WebInspector.RemoteObject.fromPayload):
+        (WebInspector.RemoteObject.prototype.get classPrototype):
+        (WebInspector.RemoteObject.prototype.isClass):
+        Update our RemoteObject model object for the new subtype
+        and its unique properties.
+
+        * UserInterface/Views/FormattedValue.js:
+        (WebInspector.FormattedValue.createElementForTypesAndValue):
+        (WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject):
+        Better handle &quot;class&quot;, as it is a new function subtype.
+
+        * UserInterface/Views/LegacyConsoleMessageImpl.js:
+        (WebInspector.LegacyConsoleMessageImpl):
+        (WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsObject):
+        Format a &quot;class&quot; with ObjectTreeView.
+
+        * UserInterface/Views/ObjectTreeArrayIndexTreeElement.js:
+        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+        * UserInterface/Views/ObjectTreePropertyTreeElement.css:
+        (.object-tree-property .getter.disabled):
+        (.object-tree-property .getter:not(.disabled):hover):
+        (.object-tree-property .getter:hover): Deleted.
+        * UserInterface/Views/ObjectTreePropertyTreeElement.js:
+        In ClassAPI mode, you cannot invoke a getter since we don't have
+        an instance to invoke it on. So disable interactivity with getters.
+
+        * UserInterface/Views/ObjectTreeView.js:
+        (WebInspector.ObjectTreeView):
+        Update the modes to include an API mode for instances and classes.
+
+        (WebInspector.ObjectTreeView.defaultModeForObject):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+        (WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
+        Simplify ObjectTree construction to automatically determine mode based
+        on the RemoteObject that was provided.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        &quot;Getter&quot; tooltip.
+
</ins><span class="cx"> 2015-03-26  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Convert TreeElement classes to ES6
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -231,6 +231,7 @@
</span><span class="cx"> localizedStrings[&quot;Full URL&quot;] = &quot;Full URL&quot;;
</span><span class="cx"> localizedStrings[&quot;Function&quot;] = &quot;Function&quot;;
</span><span class="cx"> localizedStrings[&quot;Function Name Variable&quot;] = &quot;Function Name Variable&quot;;
</span><ins>+localizedStrings[&quot;Getter&quot;] = &quot;Getter&quot;;
</ins><span class="cx"> localizedStrings[&quot;Global Breakpoints&quot;] = &quot;Global Breakpoints&quot;;
</span><span class="cx"> localizedStrings[&quot;Global Variables&quot;] = &quot;Global Variables&quot;;
</span><span class="cx"> localizedStrings[&quot;Grammar&quot;] = &quot;Grammar&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebInspector.RemoteObject = class RemoteObject
</span><span class="cx"> {
</span><del>-    constructor(objectId, type, subtype, value, description, size, preview)
</del><ins>+    constructor(objectId, type, subtype, value, description, size, classPrototype, preview)
</ins><span class="cx">     {
</span><span class="cx">         console.assert(type);
</span><span class="cx">         console.assert(!preview || preview instanceof WebInspector.ObjectPreview);
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">         this._subtype = subtype;
</span><span class="cx"> 
</span><span class="cx">         if (objectId) {
</span><del>-            // Object or Symbol.
</del><ins>+            // Object, Function, or Symbol.
</ins><span class="cx">             console.assert(!subtype || typeof subtype === &quot;string&quot;);
</span><span class="cx">             console.assert(!description || typeof description === &quot;string&quot;);
</span><span class="cx">             console.assert(!value);
</span><span class="lines">@@ -49,7 +49,11 @@
</span><span class="cx">             this._description = description;
</span><span class="cx">             this._hasChildren = type !== &quot;symbol&quot;;
</span><span class="cx">             this._size = size;
</span><ins>+            this._classPrototype = classPrototype;
</ins><span class="cx">             this._preview = preview;
</span><ins>+
+            if (subtype === &quot;class&quot;)
+                this._description = &quot;class &quot; + this._description;
</ins><span class="cx">         } else {
</span><span class="cx">             // Primitive or null.
</span><span class="cx">             console.assert(type !== &quot;object&quot; || value === null);
</span><span class="lines">@@ -65,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx">     static fromPrimitiveValue(value)
</span><span class="cx">     {
</span><del>-        return new WebInspector.RemoteObject(undefined, typeof value, undefined, undefined, value);
</del><ins>+        return new WebInspector.RemoteObject(undefined, typeof value, undefined, value, undefined, undefined, undefined);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static fromPayload(payload)
</span><span class="lines">@@ -82,6 +86,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        if (payload.classPrototype)
+            payload.classPrototype = WebInspector.RemoteObject.fromPayload(payload.classPrototype);
+
</ins><span class="cx">         if (payload.preview) {
</span><span class="cx">             // COMPATIBILITY (iOS 8): iOS 7 and 8 did not have type/subtype/description on
</span><span class="cx">             // Runtime.ObjectPreview. Copy them over from the RemoteObject.
</span><span class="lines">@@ -95,7 +102,7 @@
</span><span class="cx">             payload.preview = WebInspector.ObjectPreview.fromPayload(payload.preview);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description, payload.size, payload.preview);
</del><ins>+        return new WebInspector.RemoteObject(payload.objectId, payload.type, payload.subtype, payload.value, payload.description, payload.size, payload.classPrototype, payload.preview);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static createCallArgument(valueOrObject)
</span><span class="lines">@@ -171,6 +178,11 @@
</span><span class="cx">         return this._size || 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    get classPrototype()
+    {
+        return this._classPrototype;
+    }
+
</ins><span class="cx">     get preview()
</span><span class="cx">     {
</span><span class="cx">         return this._preview;
</span><span class="lines">@@ -323,6 +335,11 @@
</span><span class="cx">         return this._subtype === &quot;array&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    isClass()
+    {
+        return this._subtype === &quot;class&quot;;
+    }
+
</ins><span class="cx">     isCollectionType()
</span><span class="cx">     {
</span><span class="cx">         return this._subtype === &quot;map&quot; || this._subtype === &quot;set&quot; || this._subtype === &quot;weakmap&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsFormattedValuejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -86,9 +86,12 @@
</span><span class="cx">         return span;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Function: ellided in previews.
</del><ins>+    // Function: if class, show the description, otherwise ellide in previews.
</ins><span class="cx">     if (type === &quot;function&quot;) {
</span><del>-        span.textContent = isPreview ? &quot;function&quot; : displayString;
</del><ins>+        if (subtype === &quot;class&quot;)
+            span.textContent = displayString;
+        else
+            span.textContent = isPreview ? &quot;function&quot; : displayString;
</ins><span class="cx">         return span;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -125,8 +128,8 @@
</span><span class="cx">     if (object.subtype === &quot;node&quot;)
</span><span class="cx">         return WebInspector.FormattedValue.createElementForNode(object);
</span><span class="cx"> 
</span><del>-    if (object.type === &quot;object&quot;) {
-        var objectTree = new WebInspector.ObjectTreeView(object, WebInspector.ObjectTreeView.Mode.Properties, propertyPath, forceExpanding);
</del><ins>+    if (object.type === &quot;object&quot; || object.subtype === &quot;class&quot;) {
+        var objectTree = new WebInspector.ObjectTreeView(object, null, propertyPath, forceExpanding);
</ins><span class="cx">         return objectTree.element;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLegacyConsoleMessageImpljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LegacyConsoleMessageImpl.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">         &quot;set&quot;: this._formatParameterAsObject,
</span><span class="cx">         &quot;weakmap&quot;: this._formatParameterAsObject,
</span><span class="cx">         &quot;iterator&quot;: this._formatParameterAsObject,
</span><ins>+        &quot;class&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">@@ -308,7 +309,8 @@
</span><span class="cx"> 
</span><span class="cx">     _formatParameterAsObject: function(obj, elem, forceExpansion)
</span><span class="cx">     {
</span><del>-        this._objectTree = new WebInspector.ObjectTreeView(obj, WebInspector.ObjectTreeView.Mode.Properties, this._rootPropertyPathForObject(obj), forceExpansion);
</del><ins>+        // FIXME: Should have a better ObjectTreeView mode for classes (static methods and methods).
+        this._objectTree = new WebInspector.ObjectTreeView(obj, null, this._rootPropertyPathForObject(obj), forceExpansion);
</ins><span class="cx">         elem.appendChild(this._objectTree.element);
</span><span class="cx">     },
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeArrayIndexTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeArrayIndexTreeElement.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeArrayIndexTreeElement.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeArrayIndexTreeElement.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">             valueElement.appendChild(WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject(resolvedValue, this.resolvedValuePropertyPath()));
</span><span class="cx">         else {
</span><span class="cx">             if (this.property.hasGetter())
</span><del>-                container.appendChild(this.createInteractiveGetterElement());
</del><ins>+                container.appendChild(this.createInteractiveGetterElement(true));
</ins><span class="cx">             if (!this.property.hasSetter())
</span><span class="cx">                 container.appendChild(this.createReadOnlyIconElement());
</span><span class="cx">             // FIXME: What if just a setter?
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeBaseTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -113,12 +113,18 @@
</span><span class="cx">         return propertyPath.displayPath(this.propertyPathType());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    createInteractiveGetterElement()
</del><ins>+    createInteractiveGetterElement(enabled)
</ins><span class="cx">     {
</span><span class="cx">         var getterElement = document.createElement(&quot;img&quot;);
</span><span class="cx">         getterElement.className = &quot;getter&quot;;
</span><ins>+
+        if (!enabled) {
+            getterElement.classList.add(&quot;disabled&quot;);
+            getterElement.title = WebInspector.UIString(&quot;Getter&quot;);
+            return getterElement;
+        }
+
</ins><span class="cx">         getterElement.title = WebInspector.UIString(&quot;Invoke getter&quot;);
</span><del>-
</del><span class="cx">         getterElement.addEventListener(&quot;click&quot;, function(event) {
</span><span class="cx">             event.stopPropagation();
</span><span class="cx">             var lastNonPrototypeObject = this._propertyPath.lastNonPrototypeObject;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.css        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -157,7 +157,11 @@
</span><span class="cx">     margin-left: 3px;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-.object-tree-property .getter:hover {
</del><ins>+.object-tree-property .getter.disabled {
+    opacity: 0.35;
+}
+
+.object-tree-property .getter:not(.disabled):hover {
</ins><span class="cx">     opacity: 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreePropertyTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreePropertyTreeElement.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             valueOrGetterElement = document.createElement(&quot;span&quot;);
</span><span class="cx">             if (this.property.hasGetter())
</span><del>-                valueOrGetterElement.appendChild(this.createInteractiveGetterElement());
</del><ins>+                valueOrGetterElement.appendChild(this.createInteractiveGetterElement(this._mode !== WebInspector.ObjectTreeView.Mode.ClassAPI));
</ins><span class="cx">             if (!this.property.hasSetter())
</span><span class="cx">                 valueOrGetterElement.appendChild(this.createReadOnlyIconElement());
</span><span class="cx">             // FIXME: What if just a setter?
</span><span class="lines">@@ -211,7 +211,7 @@
</span><span class="cx">             container.appendChild(paramElement);
</span><span class="cx">         } else {
</span><span class="cx">             if (this.property.hasGetter())
</span><del>-                container.appendChild(this.createInteractiveGetterElement());
</del><ins>+                container.appendChild(this.createInteractiveGetterElement(this._mode !== WebInspector.ObjectTreeView.Mode.ClassAPI));
</ins><span class="cx">             if (!this.property.hasSetter())
</span><span class="cx">                 container.appendChild(this.createReadOnlyIconElement());
</span><span class="cx">             // FIXME: What if just a setter?
</span><span class="lines">@@ -304,8 +304,10 @@
</span><span class="cx">         var resolvedValue = this.resolvedValue();
</span><span class="cx">         if (resolvedValue.isCollectionType() &amp;&amp; this._mode === WebInspector.ObjectTreeView.Mode.Properties)
</span><span class="cx">             resolvedValue.getCollectionEntries(0, 100, this._updateChildrenInternal.bind(this, this._updateEntries, this._mode));
</span><ins>+        else if (this._mode === WebInspector.ObjectTreeView.Mode.ClassAPI)
+            resolvedValue.getOwnPropertyDescriptors(this._updateChildrenInternal.bind(this, this._updateProperties, WebInspector.ObjectTreeView.Mode.ClassAPI));
</ins><span class="cx">         else if (this.property.name === &quot;__proto__&quot;)
</span><del>-            resolvedValue.getOwnPropertyDescriptors(this._updateChildrenInternal.bind(this, this._updateProperties, WebInspector.ObjectTreeView.Mode.API));
</del><ins>+            resolvedValue.getOwnPropertyDescriptors(this._updateChildrenInternal.bind(this, this._updateProperties, WebInspector.ObjectTreeView.Mode.PrototypeAPI));
</ins><span class="cx">         else
</span><span class="cx">             resolvedValue.getDisplayablePropertyDescriptors(this._updateChildrenInternal.bind(this, this._updateProperties, this._mode));
</span><span class="cx">     }
</span><span class="lines">@@ -353,7 +355,7 @@
</span><span class="cx">         var resolvedValue = this.resolvedValue();
</span><span class="cx">         var isArray = resolvedValue.isArray();
</span><span class="cx">         var isPropertyMode = mode === WebInspector.ObjectTreeView.Mode.Properties || this._getterValue;
</span><del>-        var isAPI = mode === WebInspector.ObjectTreeView.Mode.API;
</del><ins>+        var isAPI = mode !== WebInspector.ObjectTreeView.Mode.Prototype;
</ins><span class="cx"> 
</span><span class="cx">         var prototypeName = undefined;
</span><span class="cx">         if (this.property.name === &quot;__proto__&quot;) {
</span><span class="lines">@@ -367,7 +369,7 @@
</span><span class="cx">             // already showed them in the Properties section.
</span><span class="cx">             if (isAPI &amp;&amp; propertyDescriptor.nativeGetter)
</span><span class="cx">                 continue;
</span><del>-            
</del><ins>+
</ins><span class="cx">             if (isArray &amp;&amp; isPropertyMode) {
</span><span class="cx">                 if (propertyDescriptor.isIndexProperty())
</span><span class="cx">                     this.appendChild(new WebInspector.ObjectTreeArrayIndexTreeElement(propertyDescriptor, propertyPath));
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsObjectTreeViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeView.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     console.assert(!propertyPath || propertyPath instanceof WebInspector.PropertyPath);
</span><span class="cx"> 
</span><span class="cx">     this._object = object;
</span><del>-    this._mode = mode || WebInspector.ObjectTreeView.Mode.Properties;
</del><ins>+    this._mode = mode || WebInspector.ObjectTreeView.defaultModeForObject(object);
</ins><span class="cx">     this._propertyPath = propertyPath || new WebInspector.PropertyPath(this._object, &quot;this&quot;);
</span><span class="cx">     this._expanded = false;
</span><span class="cx">     this._hasLosslessPreview = false;
</span><span class="lines">@@ -42,6 +42,10 @@
</span><span class="cx">     // listen for console clear events. Currently all ObjectTrees are in the console.
</span><span class="cx">     this._inConsole = true;
</span><span class="cx"> 
</span><ins>+    // Always force expanding for classes.
+    if (this._object.isClass())
+        forceExpanding = true;
+
</ins><span class="cx">     this._element = document.createElement(&quot;div&quot;);
</span><span class="cx">     this._element.className = &quot;object-tree&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -70,6 +74,14 @@
</span><span class="cx">     // FIXME: Support editable ObjectTrees.
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+WebInspector.ObjectTreeView.defaultModeForObject = function(object)
+{
+    if (object.subtype === &quot;class&quot;)
+        return WebInspector.ObjectTreeView.Mode.ClassAPI;
+
+    return WebInspector.ObjectTreeView.Mode.Properties;
+}
+
</ins><span class="cx"> WebInspector.ObjectTreeView.emptyMessageElement = function(message)
</span><span class="cx"> {
</span><span class="cx">     var emptyMessageElement = document.createElement(&quot;div&quot;);
</span><span class="lines">@@ -79,8 +91,9 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.ObjectTreeView.Mode = {
</span><del>-    Properties: Symbol(&quot;object-tree-properties&quot;),
-    API: Symbol(&quot;object-tree-api&quot;),
</del><ins>+    Properties: Symbol(&quot;object-tree-properties&quot;),      // Properties
+    PrototypeAPI: Symbol(&quot;object-tree-prototype-api&quot;), // API view on a live object instance, so getters can be invoked.
+    ClassAPI: Symbol(&quot;object-tree-class-api&quot;),         // API view without an object instance, can not invoke getters.
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.ObjectTreeView.ComparePropertyDescriptors = function(propertyA, propertyB)
</span><span class="lines">@@ -221,6 +234,8 @@
</span><span class="cx">     {
</span><span class="cx">         if (this._object.isCollectionType() &amp;&amp; this._mode === WebInspector.ObjectTreeView.Mode.Properties)
</span><span class="cx">             this._object.getCollectionEntries(0, 100, this._updateChildren.bind(this, this._updateEntries));
</span><ins>+        else if (this._object.isClass())
+            this._object.classPrototype.getDisplayablePropertyDescriptors(this._updateChildren.bind(this, this._updateProperties));
</ins><span class="cx">         else
</span><span class="cx">             this._object.getDisplayablePropertyDescriptors(this._updateChildren.bind(this, this._updateProperties));
</span><span class="cx">     },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSourceCodeTextEditorjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js (182046 => 182047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2015-03-27 01:02:38 UTC (rev 182046)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js        2015-03-27 01:42:37 UTC (rev 182047)
</span><span class="lines">@@ -1525,7 +1525,7 @@
</span><span class="cx">         content.appendChild(titleElement);
</span><span class="cx"> 
</span><span class="cx">         // FIXME: If this is a variable, it would be nice to put the variable name in the PropertyPath.
</span><del>-        var objectTree = new WebInspector.ObjectTreeView(data, WebInspector.ObjectTreeView.Mode.Properties, null);
</del><ins>+        var objectTree = new WebInspector.ObjectTreeView(data);
</ins><span class="cx">         objectTree.showOnlyProperties();
</span><span class="cx">         objectTree.expand();
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>