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

Unified Diff: Source/core/inspector/InjectedScriptSource.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
Index: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index 4d9e5fa8fd7fd84fea700358bd48a111c30cac56..4039ca792fe7a0dd5648edcc01c3d82bb5b3715d 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -149,12 +149,14 @@ function nullifyObjectProto(obj)
}
/**
- * @param {*} obj
+ * @param {number|string} obj
* @return {boolean}
*/
function isUInt32(obj)
{
- return typeof obj === "number" && obj >>> 0 === obj && (obj > 0 || 1 / obj > 0);
+ if (typeof obj === "number")
+ return obj >>> 0 === obj && (obj > 0 || 1 / obj > 0);
+ return "" + (obj >>> 0) === obj;
}
/**
@@ -167,8 +169,10 @@ function isArrayLike(obj)
if (typeof obj !== "object")
return false;
try {
- if (typeof obj.splice === "function")
- return isUInt32(obj.length);
+ if (typeof obj.splice === "function") {
+ var len = obj.length;
+ return typeof len === "number" && isUInt32(len);
+ }
} catch (e) {
}
return false;
@@ -1384,14 +1388,14 @@ InjectedScript.RemoteObject.prototype = {
preview.lossless = false;
continue;
}
- if (!descriptor.enumerable && !descriptor.isOwn)
- continue;
var name = descriptor.name;
if (name === "__proto__")
continue;
if (this.subtype === "array" && name === "length")
continue;
+ if (!descriptor.enumerable && !descriptor.isOwn && !(this.subtype === "array" && isUInt32(name)))
+ continue;
if (!("value" in descriptor)) {
preview.lossless = false;

Powered by Google App Engine
This is Rietveld 408576698