Index: lib/compiler/implementation/lib/core_patch.dart |
diff --git a/lib/compiler/implementation/lib/core_patch.dart b/lib/compiler/implementation/lib/core_patch.dart |
index aea4c6c7c2e0df68062931c651de31cddc668398..bc3e3595f1859c9776e67caf5da1d5b84eb042c6 100644 |
--- a/lib/compiler/implementation/lib/core_patch.dart |
+++ b/lib/compiler/implementation/lib/core_patch.dart |
@@ -14,3 +14,11 @@ patch class Object { |
throw new NoSuchMethodException(this, name, args); |
} |
} |
+ |
+/** |
+ * Helper function for implementing asserts. The compiler treats this specially. |
ngeoffray
2012/09/05 10:37:10
Should that be in js_helper then? I don't think it
Lasse Reichstein Nielsen
2012/09/05 12:51:20
That would make sense. Will move it.
|
+ */ |
+void _assert(condition) { |
+ if (condition is Function) condition = condition(); |
+ if (!condition) throw new AssertionError(); |
+} |