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

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10915083: Change assert implementation to not depend on a top-level function called 'assert'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 3 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
« no previous file with comments | « lib/compiler/implementation/js_backend/namer.dart ('k') | lib/compiler/implementation/lib/mock.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*/
« no previous file with comments | « lib/compiler/implementation/js_backend/namer.dart ('k') | lib/compiler/implementation/lib/mock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698