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

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

Issue 405743002: Typecheck some of ui/webui/resources/js/ with Closure compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done for tonight Created 6 years, 5 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 bae2910705bd3eb77270c46cf7ec1fb6dbac82a0..1e25769387975e7c8da75c51b132a9459dcb0914 100644
--- a/ui/webui/resources/js/assert.js
+++ b/ui/webui/resources/js/assert.js
@@ -22,3 +22,11 @@ function assert(condition, opt_message) {
throw new Error(msg);
}
}
+
+/**
+ * Insert a notReached() in cases where control flow should never hit.
+ * @param {string=} opt_message A message to show when this is hit.
+ */
+function notReached(opt_message) {
arv (Not doing code reviews) 2014/07/24 16:44:24 How about assertNotReached instead?
Dan Beam 2014/07/25 01:52:32 hmmm, blink uses ASSERT_NOT_REACHED() while chrome
+ throw new Error(opt_message || "Unreachable code hit");
+}

Powered by Google App Engine
This is Rietveld 408576698