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

Unified Diff: ui/webui/resources/js/cr/ui/menu.js

Issue 454223004: Typecheck JS files for chrome://history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@B_download
Patch Set: fixed issues Created 6 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: ui/webui/resources/js/cr/ui/menu.js
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index cb3a7c672d96dc6b7fa3a5b4a23a0ed9e9830d0e..cfd67352244434d8d7f8414c65d8fa3d5666a10c 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -86,17 +86,17 @@ cr.define('cr.ui', function() {
},
/**
- * Walks up the ancestors of |el| until a menu item belonging to this menu
+ * Walks up the ancestors of |node| until a menu item belonging to this menu
* is found.
- * @param {Element} el The element to start searching from.
+ * @param {Node} node The node to start searching from.
* @return {cr.ui.MenuItem} The found menu item or null.
* @private
*/
- findMenuItem_: function(el) {
- while (el && el.parentNode != this) {
- el = el.parentNode;
+ findMenuItem_: function(node) {
+ while (node && node.parentNode != this) {
+ node = node.parentNode;
}
- return assertInstanceof(el, MenuItem);
+ return assertInstanceof(node, MenuItem);
},
/**
@@ -105,7 +105,7 @@ cr.define('cr.ui', function() {
* @private
*/
handleMouseOver_: function(e) {
- var overItem = this.findMenuItem_(e.target);
+ var overItem = this.findMenuItem_(/** @type {Element} */(e.target));
this.selectedItem = overItem;
},
@@ -267,7 +267,7 @@ cr.define('cr.ui', function() {
/**
* The selected menu item.
- * @type {number}
+ * type {number}
*/
cr.defineProperty(Menu, 'selectedIndex', cr.PropertyKind.JS,
selectedIndexChanged);

Powered by Google App Engine
This is Rietveld 408576698