Index: Source/devtools/front_end/sdk/RemoteObject.js |
diff --git a/Source/devtools/front_end/sdk/RemoteObject.js b/Source/devtools/front_end/sdk/RemoteObject.js |
index aadeb95b8730d9fc33b45723f9fbe5162c520746..f0d6140c278f37d202a619bfd085f05f1884782f 100644 |
--- a/Source/devtools/front_end/sdk/RemoteObject.js |
+++ b/Source/devtools/front_end/sdk/RemoteObject.js |
@@ -86,6 +86,15 @@ WebInspector.RemoteObject.prototype = { |
}, |
/** |
+ * @param {string} name |
+ * @param {function(string=)} callback |
+ */ |
+ deleteProperty: function(name, callback) |
+ { |
+ throw "Not implemented"; |
+ }, |
+ |
+ /** |
* @param {function(this:Object, ...)} functionDeclaration |
* @param {!Array.<!RuntimeAgent.CallArgument>=} args |
* @param {function(?WebInspector.RemoteObject, boolean=)=} callback |
@@ -428,6 +437,38 @@ WebInspector.RemoteObjectImpl.prototype = { |
}, |
/** |
+ * @param {string} name |
+ * @param {function(string=)} callback |
+ */ |
+ deleteProperty: function(name, callback) |
+ { |
+ if (!this._objectId) { |
+ callback("Can't delete a property of non-object."); |
+ return; |
+ } |
+ |
+ var deletePropertyFunction = "function(a) { delete this[a]; return !(a in this); }"; |
+ this._runtimeAgent.callFunctionOn(this._objectId, deletePropertyFunction, [{ value: name }], true, undefined, undefined, deletePropertyCallback); |
+ |
+ /** |
+ * @param {?Protocol.Error} error |
+ * @param {!RuntimeAgent.RemoteObject} result |
+ * @param {boolean=} wasThrown |
+ */ |
+ function deletePropertyCallback(error, result, wasThrown) |
+ { |
+ if (error || wasThrown) { |
+ callback(error || result.description); |
+ return; |
+ } |
+ if (!result.value) |
+ callback("Failed to delete property."); |
+ else |
+ callback(); |
+ } |
+ }, |
+ |
+ /** |
* @param {function(?WebInspector.DOMNode)} callback |
*/ |
pushNodeToFrontend: function(callback) |