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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/commandbutton.js

Issue 667933003: Ensure existence of queried elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make some parameters non-nullable. Created 6 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: ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js b/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
index 88543c1fa4409dda86447720c90b3a59d7af8e80..27d01adcefae9bae9a1b19c95a957c45137e506c 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/commandbutton.js
@@ -60,7 +60,8 @@ CommandButton.prototype.setCommand = function(command) {
/** @type {EventListener} */ (this));
}
- if (typeof command == 'string' && command[0] == '#') {
+ if (typeof command == 'string') {
+ assert(command[0] == '#');
command = /** @type {!cr.ui.Command} */
(this.ownerDocument.getElementById(command.slice(1)));
cr.ui.decorate(command, cr.ui.Command);

Powered by Google App Engine
This is Rietveld 408576698