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

Unified Diff: ui/webui/resources/js/assert.js

Issue 604373006: Compile chrome://settings, part 9: yet another final battle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@K_blockers_from_bookmarks
Patch Set: dbeam@'s review Created 6 years, 3 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/assert.js
diff --git a/ui/webui/resources/js/assert.js b/ui/webui/resources/js/assert.js
index 4c8e7b051380e777075b48fcb5020df551c5d207..0e20ba566d55811d567229589fd9b3caacfdf9d6 100644
--- a/ui/webui/resources/js/assert.js
+++ b/ui/webui/resources/js/assert.js
@@ -54,11 +54,14 @@ function assertNotReached(opt_message) {
/**
* @param {*} value The value to check.
* @param {function(new: T, ...)} type A user-defined constructor.
+ * @param {string=} opt_message A message to show when this is hit.
* @return {T}
* @template T
*/
-function assertInstanceof(value, type) {
- if (!(value instanceof type))
- throw new Error(value + ' is not a[n] ' + (type.name || typeof type));
+function assertInstanceof(value, type, opt_message) {
+ if (!(value instanceof type)) {
+ throw new Error(opt_message ||
+ value + ' is not a[n] ' + (type.name || typeof type));
+ }
return value;
}

Powered by Google App Engine
This is Rietveld 408576698