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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js

Issue 2450663004: DevTools: do not allow using 'this' before call into super. (Closed)
Patch Set: rebaselined Created 4 years, 2 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/ui/ContextMenu.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
index e9435d709deeb8efd980dbfa813e9be6e83486ea..979c8ef911efcd41e757159a936aa3807eda950a 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ContextMenu.js
@@ -30,7 +30,7 @@
/**
* @constructor
- * @param {!WebInspector.ContextMenu} topLevelMenu
+ * @param {?WebInspector.ContextMenu} topLevelMenu
* @param {string} type
* @param {string=} label
* @param {boolean=} disabled
@@ -44,7 +44,7 @@ WebInspector.ContextMenuItem = function(topLevelMenu, type, label, disabled, che
this._checked = checked;
this._contextMenu = topLevelMenu;
if (type === "item" || type === "checkbox")
- this._id = topLevelMenu._nextId();
+ this._id = topLevelMenu ? topLevelMenu._nextId() : 0;
};
WebInspector.ContextMenuItem.prototype = {
@@ -113,7 +113,7 @@ WebInspector.ContextMenuItem.prototype = {
/**
* @constructor
* @extends {WebInspector.ContextMenuItem}
- * @param {!WebInspector.ContextMenu} topLevelMenu
+ * @param {?WebInspector.ContextMenu} topLevelMenu
* @param {string=} label
* @param {boolean=} disabled
*/
@@ -301,7 +301,8 @@ WebInspector.ContextSubMenuItem.prototype = {
*/
WebInspector.ContextMenu = function(event, useSoftMenu, x, y)
{
- WebInspector.ContextSubMenuItem.call(this, this, "");
+ WebInspector.ContextSubMenuItem.call(this, null, "");
+ this._contextMenu = this;
/** @type {!Array.<!Promise.<!Array.<!WebInspector.ContextMenu.Provider>>>} */
this._pendingPromises = [];
/** @type {!Array<!Object>} */

Powered by Google App Engine
This is Rietveld 408576698