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

Unified Diff: Source/devtools/front_end/utilities.js

Issue 143263003: DevTools: Fix console.log for arrays in some corner cases. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/devtools/front_end/utilities.js
diff --git a/Source/devtools/front_end/utilities.js b/Source/devtools/front_end/utilities.js
index ec577153e62d453c0bc9977fabeef12f935302aa..0f6b84de2cb7297b93e7e6f539ed956834666ca7 100644
--- a/Source/devtools/front_end/utilities.js
+++ b/Source/devtools/front_end/utilities.js
@@ -276,6 +276,18 @@ String.naturalOrderComparator = function(a, b)
}
/**
+ * @param {string} name
+ * @param {number=} arrayLength
+ * @return {boolean}
+ */
+String.isArrayIndexPropertyName = function(name, arrayLength)
pfeldman 2014/01/23 16:19:02 We define these on prototype.
aandrey 2014/01/24 06:22:04 Didn't work in this case. Because: typeof name ==
+{
+ // Array index check according to the ES5-15.4.
+ var index = name >>> 0;
+ return String(index) === name && index !== 0xffffffff && (typeof arrayLength === "undefined" || index < arrayLength);
+}
+
+/**
* @param {number} num
* @param {number} min
* @param {number} max
« Source/devtools/front_end/ConsoleMessage.js ('K') | « Source/devtools/front_end/ConsoleMessage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698