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

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 10516006: Issue 3268. Support for replacing 'assert' statement with 'assert' function (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes for review comments Created 8 years, 6 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 | « no previous file | compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
diff --git a/compiler/java/com/google/dart/compiler/DartCompiler.java b/compiler/java/com/google/dart/compiler/DartCompiler.java
index 796d5f1c28d2fc183f788c2f3f6d301ee9b2252a..dd85e0b109ce94f4687c1b3210255d64f2e9e1f0 100644
--- a/compiler/java/com/google/dart/compiler/DartCompiler.java
+++ b/compiler/java/com/google/dart/compiler/DartCompiler.java
@@ -499,8 +499,7 @@ public class DartCompiler {
}
// The library scope can then be constructed, containing types declared
- // in the library, and // types declared in the imports. Loop can be
- // parallelized.
+ // in the library, and types declared in the imports. Loop can be parallelized.
for (LibraryUnit lib : libs) {
new TopLevelElementBuilder().fillInLibraryScope(lib, context);
}
@@ -811,6 +810,11 @@ public class DartCompiler {
} finally {
Closeables.close(r, failed);
}
+
+ // auto-magically define "assert" function
+ if (dartSrc.getUri().toString().equals("dart://core/runtime/object.dart")) {
+ srcCode += "\nvoid assert(x) {}";
+ }
DartScannerParserContext parserContext =
new DartScannerParserContext(dartSrc, srcCode, context, context.getCompilerMetrics());
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/LibraryDepsVisitor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698