Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1188)

Unified Diff: Source/devtools/front_end/sdk/RemoteObject.js

Issue 844563003: DevTools: Fix console not showing array items inherited from prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/RemoteObject.js
diff --git a/Source/devtools/front_end/sdk/RemoteObject.js b/Source/devtools/front_end/sdk/RemoteObject.js
index f6bd216028e3eaf003fc9adb4a9912b1501957af..5d2844d5ebf6e06bcdce976d61be6bfaa8a43526 100644
--- a/Source/devtools/front_end/sdk/RemoteObject.js
+++ b/Source/devtools/front_end/sdk/RemoteObject.js
@@ -190,6 +190,20 @@ WebInspector.RemoteObject.type = function(remoteObject)
}
/**
+ * @param {!WebInspector.RemoteObject|!RuntimeAgent.RemoteObject|!RuntimeAgent.ObjectPreview} object
+ * @return {number}
+ */
+WebInspector.RemoteObject.arrayLength = function(object)
+{
+ if (object.subtype !== "array")
+ return 0;
+ var matches = object.description.match(/\[([0-9]+)\]/);
+ if (!matches)
+ return 0;
+ return parseInt(matches[1], 10);
+}
+
+/**
* @param {!RuntimeAgent.RemoteObject|!WebInspector.RemoteObject|number|string|boolean|undefined|null} object
* @return {!RuntimeAgent.CallArgument}
*/
@@ -624,13 +638,7 @@ WebInspector.RemoteObjectImpl.prototype = {
*/
arrayLength: function()
{
- if (this.subtype !== "array")
- return 0;
-
- var matches = this._description.match(/\[([0-9]+)\]/);
- if (!matches)
- return 0;
- return parseInt(matches[1], 10);
+ return WebInspector.RemoteObject.arrayLength(this);
},
/**
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698