Web Inspector: Regression: Preview for [[null]] shouldn't be []
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 22:43:26 +0000 (22:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Mar 2015 22:43:26 +0000 (22:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143208

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-30
Reviewed by Mark Lam.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
Handle null when generating simple object previews.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/model/remote-object-expected.txt
LayoutTests/inspector/model/remote-object.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/InjectedScriptSource.js

index 09e7504..fcfe9e5 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-30  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Regression: Preview for [[null]] shouldn't be []
+        https://bugs.webkit.org/show_bug.cgi?id=143208
+
+        Reviewed by Mark Lam.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+
 2015-03-30  Antti Koivisto  <antti@apple.com>
 
         Don't cache resources that are very unlikely to be reused
index 248095f..e701e64 100644 (file)
@@ -712,6 +712,91 @@ EXPRESSION: [true, 1, 1.234, 'string', /regex/]
 }
 
 -----------------------------------------------------
+EXPRESSION: [[null]]
+{
+  "_type": "object",
+  "_subtype": "array",
+  "_objectId": "<filtered>",
+  "_description": "Array",
+  "_size": 1,
+  "_preview": {
+    "_type": "object",
+    "_subtype": "array",
+    "_description": "Array",
+    "_lossless": true,
+    "_overflow": false,
+    "_size": 1,
+    "_properties": [
+      {
+        "_name": "0",
+        "_type": "object",
+        "_subtype": "array",
+        "_valuePreview": {
+          "_type": "object",
+          "_subtype": "array",
+          "_description": "Array",
+          "_lossless": true,
+          "_overflow": false,
+          "_size": 1,
+          "_properties": [
+            {
+              "_name": "0",
+              "_type": "object",
+              "_subtype": "null",
+              "_value": "null"
+            }
+          ],
+          "_entries": null
+        }
+      }
+    ],
+    "_entries": null
+  }
+}
+
+-----------------------------------------------------
+EXPRESSION: [[undefined]]
+{
+  "_type": "object",
+  "_subtype": "array",
+  "_objectId": "<filtered>",
+  "_description": "Array",
+  "_size": 1,
+  "_preview": {
+    "_type": "object",
+    "_subtype": "array",
+    "_description": "Array",
+    "_lossless": true,
+    "_overflow": false,
+    "_size": 1,
+    "_properties": [
+      {
+        "_name": "0",
+        "_type": "object",
+        "_subtype": "array",
+        "_valuePreview": {
+          "_type": "object",
+          "_subtype": "array",
+          "_description": "Array",
+          "_lossless": true,
+          "_overflow": false,
+          "_size": 1,
+          "_properties": [
+            {
+              "_name": "0",
+              "_type": "undefined",
+              "_value": "undefined"
+            }
+          ],
+          "_entries": null
+        }
+      }
+    ],
+    "_entries": null
+  }
+}
+
+-----------------------------------------------------
 EXPRESSION: [{a:1}, {b:2}, {c:2}]
 {
   "_type": "object",
index 7fd472c..4bd8f8f 100644 (file)
@@ -75,6 +75,8 @@ function test()
         {expression: "[0, -0, 1, 2]"},
         {expression: "[[1],[2],[3]]"},
         {expression: "[true, 1, 1.234, 'string', /regex/]"},
+        {expression: "[[null]]"},
+        {expression: "[[undefined]]"},
         {expression: "[{a:1}, {b:2}, {c:2}]"},
         {expression: "[[{a:1}, {b:2}, {c:2}]]"},
         {expression: "arr = []; arr.length = 100; arr"}, // 100 empty elements
index 012fb52..ea918ed 100644 (file)
@@ -1,3 +1,13 @@
+2015-03-30  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Regression: Preview for [[null]] shouldn't be []
+        https://bugs.webkit.org/show_bug.cgi?id=143208
+
+        Reviewed by Mark Lam.
+
+        * inspector/InjectedScriptSource.js:
+        Handle null when generating simple object previews.
+
 2015-03-30  Per Arne Vollan  <peavo@outlook.com>
 
         Avoid using hardcoded values for JSValue::Int32Tag, if possible.
index 729921c..8425c7b 100644 (file)
@@ -1175,6 +1175,10 @@ InjectedScript.RemoteObject.prototype = {
         if (injectedScript.isPrimitiveValue(object) || isSymbol(object))
             return true;
 
+        // Null.
+        if (object === null)
+            return true;
+
         // Cyclic objects.
         if (knownObjects.has(object))
             return false;