Title: [199529] trunk
Revision
199529
Author
[email protected]
Date
2016-04-13 21:59:49 -0700 (Wed, 13 Apr 2016)

Log Message

JSContext Inspector: Improve Class instances and JSC API Exported Values view in Console / ObjectTree
https://bugs.webkit.org/show_bug.cgi?id=156566
<rdar://problem/16392365>

Patch by Joseph Pecoraro <[email protected]> on 2016-04-13
Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/InjectedScriptSource.js:
(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
Treat non-basic object types as not lossless so they can be expanded.
Show non-enumerable native getters in Object previews.

LayoutTests:

* inspector/console/console-table-expected.txt:
* inspector/model/remote-object.html:
* platform/mac/inspector/model/remote-object-expected.txt:
More values are treated as not-lossless and therefore expandable.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199528 => 199529)


--- trunk/LayoutTests/ChangeLog	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/LayoutTests/ChangeLog	2016-04-14 04:59:49 UTC (rev 199529)
@@ -1,3 +1,16 @@
+2016-04-13  Joseph Pecoraro  <[email protected]>
+
+        JSContext Inspector: Improve Class instances and JSC API Exported Values view in Console / ObjectTree
+        https://bugs.webkit.org/show_bug.cgi?id=156566
+        <rdar://problem/16392365>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/console/console-table-expected.txt:
+        * inspector/model/remote-object.html:
+        * platform/mac/inspector/model/remote-object-expected.txt:
+        More values are treated as not-lossless and therefore expandable.
+
 2016-04-13  Daniel Bates  <[email protected]>
 
         CSP: Nested browsing context created for <object> or <embed> should respect object-src directive

Modified: trunk/LayoutTests/inspector/console/console-table-expected.txt (199528 => 199529)


--- trunk/LayoutTests/inspector/console/console-table-expected.txt	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/LayoutTests/inspector/console/console-table-expected.txt	2016-04-14 04:59:49 UTC (rev 199529)
@@ -292,7 +292,7 @@
         "_type": "object",
         "_subtype": "array",
         "_description": "Array",
-        "_lossless": true,
+        "_lossless": false,
         "_overflow": false,
         "_size": 3,
         "_properties": [
@@ -304,7 +304,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {
@@ -331,7 +331,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {
@@ -358,7 +358,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {
@@ -410,7 +410,7 @@
         "_type": "object",
         "_subtype": "array",
         "_description": "Array",
-        "_lossless": true,
+        "_lossless": false,
         "_overflow": false,
         "_size": 3,
         "_properties": [
@@ -422,7 +422,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {
@@ -449,7 +449,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {
@@ -476,7 +476,7 @@
               "_listeners": null,
               "_type": "object",
               "_description": "Person",
-              "_lossless": true,
+              "_lossless": false,
               "_overflow": false,
               "_properties": [
                 {

Modified: trunk/LayoutTests/inspector/model/remote-object.html (199528 => 199529)


--- trunk/LayoutTests/inspector/model/remote-object.html	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/LayoutTests/inspector/model/remote-object.html	2016-04-14 04:59:49 UTC (rev 199529)
@@ -175,6 +175,7 @@
 
         {_expression_: "Person = class Person { constructor(name){} get fullName(){} methodName(p1, p2){} }; Person"}, // Constructor => class type
         {_expression_: "Person.prototype.methodName"}, // Method => just a function type
+        {_expression_: "new Person"}, // Instance, not lossless, it's prototype may have interesting methods to show
         {_expression_: "Alpha = class A { methodA(){} }; Beta = class B extends Alpha { methodB(){} }; Beta"},
         {_expression_: "[Beta]"},
 

Modified: trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt (199528 => 199529)


--- trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2016-04-14 04:59:49 UTC (rev 199529)
@@ -1120,7 +1120,7 @@
     "_type": "object",
     "_subtype": "array",
     "_description": "Int32Array",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_size": 4,
     "_properties": [
@@ -1166,7 +1166,7 @@
     "_type": "object",
     "_subtype": "array",
     "_description": "Int32Array",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_size": 4,
     "_properties": [
@@ -1481,7 +1481,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Foo",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [],
     "_entries": null
@@ -1498,7 +1498,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Foo2",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [],
     "_entries": null
@@ -1515,7 +1515,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Foo3",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [],
     "_entries": null
@@ -1567,7 +1567,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Bar2",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -1640,7 +1640,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "ArrayBuffer",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -1664,7 +1664,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "DataView",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -1678,6 +1678,12 @@
         "_name": "byteLength",
         "_type": "number",
         "_value": "16"
+      },
+      {
+        "_listeners": null,
+        "_name": "buffer",
+        "_type": "object",
+        "_value": "ArrayBuffer"
       }
     ],
     "_entries": null
@@ -2297,7 +2303,7 @@
     "_type": "object",
     "_subtype": "error",
     "_description": "TypeError: undefined is not an object (evaluating '[].x.x')",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -2341,7 +2347,7 @@
     "_type": "object",
     "_subtype": "error",
     "_description": "SyntaxError: Unexpected token ')'",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4492,7 +4498,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Promise",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4517,7 +4523,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Promise",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4549,7 +4555,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Promise",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4581,7 +4587,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Promise",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4613,7 +4619,7 @@
     "_listeners": null,
     "_type": "object",
     "_description": "Promise",
-    "_lossless": true,
+    "_lossless": false,
     "_overflow": false,
     "_properties": [
       {
@@ -4754,6 +4760,23 @@
 }
 
 -----------------------------------------------------
+_expression_: new Person
+{
+  "_type": "object",
+  "_objectId": "<filtered>",
+  "_description": "Person",
+  "_preview": {
+    "_listeners": null,
+    "_type": "object",
+    "_description": "Person",
+    "_lossless": false,
+    "_overflow": false,
+    "_properties": [],
+    "_entries": null
+  }
+}
+
+-----------------------------------------------------
 _expression_: Alpha = class A { methodA(){} }; Beta = class B extends Alpha { methodB(){} }; Beta
 {
   "_type": "function",

Modified: trunk/Source/_javascript_Core/ChangeLog (199528 => 199529)


--- trunk/Source/_javascript_Core/ChangeLog	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-04-14 04:59:49 UTC (rev 199529)
@@ -1,3 +1,16 @@
+2016-04-13  Joseph Pecoraro  <[email protected]>
+
+        JSContext Inspector: Improve Class instances and JSC API Exported Values view in Console / ObjectTree
+        https://bugs.webkit.org/show_bug.cgi?id=156566
+        <rdar://problem/16392365>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/InjectedScriptSource.js:
+        (InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
+        Treat non-basic object types as not lossless so they can be expanded.
+        Show non-enumerable native getters in Object previews.
+
 2016-04-13  Michael Saboff  <[email protected]>
 
         Some tests fail with ES6 `u` (Unicode) flag for regular expressions

Modified: trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js (199528 => 199529)


--- trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2016-04-14 03:21:29 UTC (rev 199528)
+++ trunk/Source/_javascript_Core/inspector/InjectedScriptSource.js	2016-04-14 04:59:49 UTC (rev 199529)
@@ -1128,15 +1128,24 @@
 
             // Do not show "__proto__" in preview.
             var name = descriptor.name;
-            if (name === "__proto__")
+            if (name === "__proto__") {
+                // Non basic __proto__ objects may have interesting, non-enumerable, methods to show.
+                if (descriptor.value && descriptor.value.constructor
+                    && descriptor.value.constructor !== Object
+                    && descriptor.value.constructor !== Array
+                    && descriptor.value.constructor !== RegExp)
+                    preview.lossless = false;
                 continue;
+            }
 
             // For arrays, only allow indexes.
             if (this.subtype === "array" && !isUInt32(name))
                 continue;
 
-            // Do not show non-enumerable non-own properties. Special case to allow array indexes that may be on the prototype.
-            if (!descriptor.enumerable && !descriptor.isOwn && this.subtype !== "array")
+            // Do not show non-enumerable non-own properties.
+            // Special case to allow array indexes that may be on the prototype.
+            // Special case to allow native getters on non-RegExp objects.
+            if (!descriptor.enumerable && !descriptor.isOwn && !(this.subtype === "array" || (this.subtype !== "regexp" && descriptor.nativeGetter)))
                 continue;
 
             // If we have a filter, only show properties in the filter.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to