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

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

Issue 83383002: DevTools: Allow setting -0 value to object property (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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/RemoteObject.js
diff --git a/Source/devtools/front_end/RemoteObject.js b/Source/devtools/front_end/RemoteObject.js
index 8af134404c5f7e6624c2e9742e76d9873d50b5cd..3e949aab6858d96ac21e8e1b85316b6a4828ceed 100644
--- a/Source/devtools/front_end/RemoteObject.js
+++ b/Source/devtools/front_end/RemoteObject.js
@@ -251,7 +251,7 @@ WebInspector.RemoteObject.prototype = {
return;
}
- RuntimeAgent.evaluate.invoke({expression:value, doNotPauseOnExceptionsAndMuteConsole:true}, evaluatedCallback.bind(this));
+ RuntimeAgent.evaluate.invoke({expression: value, doNotPauseOnExceptionsAndMuteConsole: true, forceObjectId: true}, evaluatedCallback.bind(this));
/**
* @param {?Protocol.Error} error
@@ -285,12 +285,8 @@ WebInspector.RemoteObject.prototype = {
// where property was defined; so do we.
var setPropertyValueFunction = "function(a, b) { this[a] = b; }";
- // Special case for NaN, Infinity and -Infinity
- if (result.type === "number" && typeof result.value !== "number")
- setPropertyValueFunction = "function(a) { this[a] = " + result.description + "; }";
-
delete result.description; // Optimize on traffic.
- RuntimeAgent.callFunctionOn(this._objectId, setPropertyValueFunction, [{ value:name }, result], true, undefined, undefined, propertySetCallback.bind(this));
+ RuntimeAgent.callFunctionOn(this._objectId, setPropertyValueFunction, [{ value: name }, result], true, undefined, undefined, undefined, propertySetCallback.bind(this));
/**
* @param {?Protocol.Error} error
@@ -350,7 +346,7 @@ WebInspector.RemoteObject.prototype = {
callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
}
- RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, undefined, undefined, mycallback);
+ RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, undefined, undefined, undefined, mycallback);
},
/**
@@ -370,7 +366,7 @@ WebInspector.RemoteObject.prototype = {
callback((error || wasThrown) ? null : result.value);
}
- RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, true, false, mycallback);
+ RuntimeAgent.callFunctionOn(this._objectId, functionDeclaration.toString(), args, true, true, false, false, mycallback);
},
release: function()
@@ -538,20 +534,7 @@ WebInspector.ScopeRemoteObject.prototype = {
*/
doSetObjectPropertyValue: function(result, name, callback)
{
- var newValue;
-
- switch (result.type) {
- case "undefined":
- newValue = {};
- break;
- case "object":
- case "function":
- newValue = { objectId: result.objectId };
- break;
- default:
- newValue = { value: result.value };
- }
-
+ var newValue = { objectId: result.objectId, value: result.value };
DebuggerAgent.setVariableValue(this._scopeRef.number, name, newValue, this._scopeRef.callFrameId, this._scopeRef.functionId, setVariableValueCallback.bind(this));
/**

Powered by Google App Engine
This is Rietveld 408576698