Index: lib/compiler/implementation/lib/js_helper.dart |
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart |
index 683929aa218674aa657813331af055b9885bbc21..cfe19d18aecc0e25dca8dae0a7b2fd3548e36e70 100644 |
--- a/lib/compiler/implementation/lib/js_helper.dart |
+++ b/lib/compiler/implementation/lib/js_helper.dart |
@@ -1222,6 +1222,14 @@ class FallThroughErrorImplementation implements FallThroughError { |
} |
/** |
+ * Helper function for implementing asserts. The compiler treats this specially. |
+ */ |
+void assert(condition) { |
+ if (condition is Function) condition = condition(); |
+ if (!condition) throw new AssertionError(); |
+} |
+ |
+/** |
* Called by generated code when a method that must be statically |
* resolved cannot be found. |
*/ |