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 afb3acb83be8268496931bacc242db080cb1f5d7..4e479fe190bd1dbba5a3a50399a3b6ad6e598f4d 100644 |
--- a/lib/compiler/implementation/lib/js_helper.dart |
+++ b/lib/compiler/implementation/lib/js_helper.dart |
@@ -811,7 +811,7 @@ unwrapException(ex) { |
// Examples: |
// x.foo is not a function |
// 'undefined' is not a function (evaluating 'x.foo(1,2,3)') |
- // Object doesn't support property or method 'foo' which sets the error |
+ // Object doesn't support property or method 'foo' which sets the error |
// code 438 in IE. |
// TODO(kasperl): Compute the right name if possible. |
return new NoSuchMethodException('', '<unknown>', []); |
@@ -1188,6 +1188,14 @@ interface JavaScriptIndexingBehavior { |
} |
/** |
+ * 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. |
*/ |