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

Unified Diff: Source/core/inspector/InjectedScriptSource.js

Issue 464793002: DevTools: Simplify isArrayLike() in injected script and extend InjectedScriptHost.type() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test fix Created 6 years, 4 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 9f58f9d06a49deecb211d20718a5f0034f3185c5..3db4d8f0af5c237052288ef96cea7c08b7f3ee68 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -152,11 +152,7 @@ function isArrayLike(obj)
if (typeof obj.splice === "function")
return isFinite(obj.length);
var str = InjectedScriptHost.callFunction(Object.prototype.toString, obj);
- if (str === "[object Array]" ||
- str === "[object Arguments]" ||
- str === "[object HTMLCollection]" ||
- str === "[object NodeList]" ||
- str === "[object DOMTokenList]")
+ if (str === "[object Arguments]")
return isFinite(obj.length);
} catch (e) {
}
@@ -982,9 +978,6 @@ InjectedScript.prototype = {
if (this.isPrimitiveValue(obj))
return null;
- if (this._isHTMLAllCollection(obj))
- return "array";
-
var preciseType = InjectedScriptHost.type(obj);
if (preciseType)
return preciseType;
@@ -1039,7 +1032,7 @@ InjectedScript.prototype = {
if (typeof obj === "function")
return toString(obj);
- if (isSymbol(obj)) {
+ if (subtype === "symbol") {
try {
return InjectedScriptHost.callFunction(Symbol.prototype.toString, obj) || "Symbol";
} catch (e) {

Powered by Google App Engine
This is Rietveld 408576698