Title: [215855] trunk
Revision
215855
Author
[email protected]
Date
2017-04-26 22:12:53 -0700 (Wed, 26 Apr 2017)

Log Message

Web Inspector: Uint8ClampedArray should be treated like an array, not an object
https://bugs.webkit.org/show_bug.cgi?id=171364
<rdar://problem/10873037>

Patch by Joseph Pecoraro <[email protected]> on 2017-04-26
Reviewed by Sam Weinig.

Source/_javascript_Core:

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Treat Uint8ClampedArray (like other Typed Arrays) as an array.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
* platform/mac/inspector/model/remote-object-expected.txt:
Test a Uint8ClampedArray is treated like an array.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215854 => 215855)


--- trunk/LayoutTests/ChangeLog	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/LayoutTests/ChangeLog	2017-04-27 05:12:53 UTC (rev 215855)
@@ -1,3 +1,16 @@
+2017-04-26  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Uint8ClampedArray should be treated like an array, not an object
+        https://bugs.webkit.org/show_bug.cgi?id=171364
+        <rdar://problem/10873037>
+
+        Reviewed by Sam Weinig.
+
+        * inspector/model/remote-object-expected.txt:
+        * inspector/model/remote-object.html:
+        * platform/mac/inspector/model/remote-object-expected.txt:
+        Test a Uint8ClampedArray is treated like an array.
+
 2017-04-26  Saam Barati  <[email protected]>
 
         ASSERTION FAILED: inIndex != notFound in JSC::invalidParameterInSourceAppender()

Modified: trunk/LayoutTests/inspector/model/remote-object-expected.txt (215854 => 215855)


--- trunk/LayoutTests/inspector/model/remote-object-expected.txt	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/LayoutTests/inspector/model/remote-object-expected.txt	2017-04-27 05:12:53 UTC (rev 215855)
@@ -1065,6 +1065,77 @@
 }
 
 -----------------------------------------------------
+_expression_: new Uint8ClampedArray(12)
+{
+  "_type": "object",
+  "_subtype": "array",
+  "_objectId": "<filtered>",
+  "_description": "Uint8ClampedArray",
+  "_size": 12,
+  "_preview": {
+    "_type": "object",
+    "_subtype": "array",
+    "_description": "Uint8ClampedArray",
+    "_lossless": false,
+    "_overflow": true,
+    "_size": 12,
+    "_properties": [
+      {
+        "_name": "0",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "1",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "2",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "3",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "4",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "5",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "6",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "7",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "8",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "9",
+        "_type": "number",
+        "_value": "0"
+      }
+    ],
+    "_entries": null
+  }
+}
+
+-----------------------------------------------------
 _expression_: var intArray = new Int32Array(new ArrayBuffer(16)); for (var i = 0; i < intArray.length; ++i) intArray[i] = i; intArray
 {
   "_type": "object",

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


--- trunk/LayoutTests/inspector/model/remote-object.html	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/LayoutTests/inspector/model/remote-object.html	2017-04-27 05:12:53 UTC (rev 215855)
@@ -87,6 +87,7 @@
         // Array-like (Arguments, TypedArrays)
         {_expression_: "a = null; (function() { a = arguments; })(1, '2', /3/); a"},
         {_expression_: "new Int32Array(new ArrayBuffer(16))"},
+        {_expression_: "new Uint8ClampedArray(12)"},
         {_expression_: "var intArray = new Int32Array(new ArrayBuffer(16)); for (var i = 0; i < intArray.length; ++i) intArray[i] = i; intArray"},
         {_expression_: "var buffer = new ArrayBuffer(10000000); var int8View = new Int8Array(buffer); int8View"}, // 10000000 elements.
 

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


--- trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/LayoutTests/platform/mac/inspector/model/remote-object-expected.txt	2017-04-27 05:12:53 UTC (rev 215855)
@@ -1065,6 +1065,77 @@
 }
 
 -----------------------------------------------------
+_expression_: new Uint8ClampedArray(12)
+{
+  "_type": "object",
+  "_subtype": "array",
+  "_objectId": "<filtered>",
+  "_description": "Uint8ClampedArray",
+  "_size": 12,
+  "_preview": {
+    "_type": "object",
+    "_subtype": "array",
+    "_description": "Uint8ClampedArray",
+    "_lossless": false,
+    "_overflow": true,
+    "_size": 12,
+    "_properties": [
+      {
+        "_name": "0",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "1",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "2",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "3",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "4",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "5",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "6",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "7",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "8",
+        "_type": "number",
+        "_value": "0"
+      },
+      {
+        "_name": "9",
+        "_type": "number",
+        "_value": "0"
+      }
+    ],
+    "_entries": null
+  }
+}
+
+-----------------------------------------------------
 _expression_: var intArray = new Int32Array(new ArrayBuffer(16)); for (var i = 0; i < intArray.length; ++i) intArray[i] = i; intArray
 {
   "_type": "object",

Modified: trunk/Source/_javascript_Core/ChangeLog (215854 => 215855)


--- trunk/Source/_javascript_Core/ChangeLog	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-04-27 05:12:53 UTC (rev 215855)
@@ -1,3 +1,15 @@
+2017-04-26  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Uint8ClampedArray should be treated like an array, not an object
+        https://bugs.webkit.org/show_bug.cgi?id=171364
+        <rdar://problem/10873037>
+
+        Reviewed by Sam Weinig.
+
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::subtype):
+        Treat Uint8ClampedArray (like other Typed Arrays) as an array.
+
 2017-04-26  Saam Barati  <[email protected]>
 
         Print Wasm function index in stack trace

Modified: trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp (215854 => 215855)


--- trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp	2017-04-27 03:38:12 UTC (rev 215854)
+++ trunk/Source/_javascript_Core/inspector/JSInjectedScriptHost.cpp	2017-04-27 05:12:53 UTC (rev 215855)
@@ -190,12 +190,16 @@
     if (object && object->getDirect(exec->vm(), exec->vm().propertyNames->builtinNames().arrayIteratorNextIndexPrivateName()))
         return jsNontrivialString(exec, ASCIILiteral("iterator"));
 
-    if (value.inherits(vm, JSInt8Array::info()) || value.inherits(vm, JSInt16Array::info()) || value.inherits(vm, JSInt32Array::info()))
+    if (value.inherits(vm, JSInt8Array::info())
+        || value.inherits(vm, JSInt16Array::info())
+        || value.inherits(vm, JSInt32Array::info())
+        || value.inherits(vm, JSUint8Array::info())
+        || value.inherits(vm, JSUint8ClampedArray::info())
+        || value.inherits(vm, JSUint16Array::info())
+        || value.inherits(vm, JSUint32Array::info())
+        || value.inherits(vm, JSFloat32Array::info())
+        || value.inherits(vm, JSFloat64Array::info()))
         return jsNontrivialString(exec, ASCIILiteral("array"));
-    if (value.inherits(vm, JSUint8Array::info()) || value.inherits(vm, JSUint16Array::info()) || value.inherits(vm, JSUint32Array::info()))
-        return jsNontrivialString(exec, ASCIILiteral("array"));
-    if (value.inherits(vm, JSFloat32Array::info()) || value.inherits(vm, JSFloat64Array::info()))
-        return jsNontrivialString(exec, ASCIILiteral("array"));
 
     return impl().subtype(exec, value);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to