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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2214193002: [DevTools] Introduce unserializableValue in RemoteObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hidden Created 4 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: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
index 3827720be636853002c08a0bad049ec27d91cdfb..f73455959f79b26777661187d0d937b9157543db 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -150,7 +150,7 @@ WebInspector.RuntimeModel.prototype = {
createRemoteObject: function(payload)
{
console.assert(typeof payload === "object", "Remote object payload should only be an object");
- return new WebInspector.RemoteObjectImpl(this.target(), payload.objectId, payload.type, payload.subtype, payload.value, payload.description, payload.preview, payload.customPreview);
+ return new WebInspector.RemoteObjectImpl(this.target(), payload.objectId, payload.type, payload.subtype, payload.value, payload.unserializableValue, payload.description, payload.preview, payload.customPreview);
},
/**
@@ -160,16 +160,31 @@ WebInspector.RuntimeModel.prototype = {
*/
createScopeRemoteObject: function(payload, scopeRef)
{
- return new WebInspector.ScopeRemoteObject(this.target(), payload.objectId, scopeRef, payload.type, payload.subtype, payload.value, payload.description, payload.preview);
+ return new WebInspector.ScopeRemoteObject(this.target(), payload.objectId, scopeRef, payload.type, payload.subtype, payload.value, payload.unserializableValue, payload.description, payload.preview);
},
/**
- * @param {number|string|boolean} value
+ * @param {number|string|boolean|undefined} value
* @return {!WebInspector.RemoteObject}
*/
createRemoteObjectFromPrimitiveValue: function(value)
{
- return new WebInspector.RemoteObjectImpl(this.target(), undefined, typeof value, undefined, value);
+ var type = typeof value;
+ var unserializableValue = undefined;
+ if (typeof value === "number") {
+ var description = String(value);
+ if (value === 0 && 1 / value < 0)
+ unserializableValue = RuntimeAgent.UnserializableValue.Negative0;
+ if (description === "NaN")
+ unserializableValue = RuntimeAgent.UnserializableValue.NaN;
+ if (description === "Infinity")
+ unserializableValue = RuntimeAgent.UnserializableValue.Infinity;
+ if (description === "-Infinity")
+ unserializableValue = RuntimeAgent.UnserializableValue.NegativeInfinity;
+ if (typeof unserializableValue !== "undefined")
+ value = undefined;
+ }
+ return new WebInspector.RemoteObjectImpl(this.target(), undefined, type, undefined, value, unserializableValue);
},
/**

Powered by Google App Engine
This is Rietveld 408576698