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

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

Issue 200423008: DevTools: Extend Runtime.CallArgument to pass numbers that can not be JSON-stringified. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 9 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 | « no previous file | Source/devtools/front_end/RemoteObject.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InjectedScriptSource.js
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index e0c70e9bba1aaf858469917384d97b9fe4f99e5d..3d761aee20a273e74b853e9459b5b21ce9af9ae7 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -581,7 +581,10 @@ InjectedScript.prototype = {
return resolvedArg;
} else if ("value" in callArgumentJson) {
- return callArgumentJson.value;
+ var value = callArgumentJson.value;
+ if (callArgumentJson.type === "number" && typeof value !== "number")
+ value = Number(value);
+ return value;
}
return undefined;
},
@@ -1007,8 +1010,19 @@ InjectedScript.RemoteObject = function(object, objectGroupName, forceValueType,
this.subtype = "null";
// Provide user-friendly number values.
- if (this.type === "number")
+ if (this.type === "number") {
this.description = toStringDescription(object);
+ // Override "value" property for values that can not be JSON-stringified.
+ switch (this.description) {
+ case "NaN":
+ case "Infinity":
+ case "-Infinity":
+ case "-0":
+ this.value = this.description;
+ break;
+ }
+ }
+
return;
}
« no previous file with comments | « no previous file | Source/devtools/front_end/RemoteObject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698