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

Unified Diff: Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js

Issue 323423002: DevTools: Deleting object property in console would just assign it to undefined. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | « Source/devtools/front_end/sdk/RemoteObject.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
diff --git a/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js b/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
index 67a29a9bae69c49c5e5b7965bb7e1f0c75f3dd2b..0f9bd6125fc360ae42daf71db33badbbd39ba106 100644
--- a/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
+++ b/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
@@ -449,14 +449,17 @@ WebInspector.WatchExpressionTreeElement.prototype = {
},
/**
- * @param {!Event=} event
- * @return {!Array.<!Element|string>}
+ * @override
+ * @return {{element: !Element, value: (string|undefined)}}
*/
- elementAndValueToEdit: function(event)
+ elementAndValueToEdit: function()
{
- return [this.nameElement, this.property.name.trim()];
+ return { element: this.nameElement, value: this.property.name.trim() };
},
+ /**
+ * @override
+ */
editingCancelled: function(element, context)
{
if (!context.elementToEdit.textContent)
@@ -465,14 +468,14 @@ WebInspector.WatchExpressionTreeElement.prototype = {
WebInspector.ObjectPropertyTreeElement.prototype.editingCancelled.call(this, element, context);
},
- applyExpression: function(expression, updateInterface)
+ /**
+ * @override
+ * @param {string} expression
+ */
+ applyExpression: function(expression)
{
expression = expression.trim();
-
- if (!expression)
- expression = null;
-
- this.property.name = expression;
+ this.property.name = expression || null;
this.treeOutline.section.updateExpression(this, expression);
},
« no previous file with comments | « Source/devtools/front_end/sdk/RemoteObject.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698