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"); |
+} |