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

Unified Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10692073: Start emitting top-level functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index 77fb893676bd15ea9ac260f85f8aee99029e312c..f713e86a6d2034a878babd73c785f8787097619e 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -43,9 +43,14 @@ class DartBackend extends Backend {
}
try {
+ StringBuffer sb = new StringBuffer();
resolvedElements.forEach((element, treeElements) {
- bailout('I can do nothing right now.');
+ if (!element.isTopLevel()) {
+ bailout('Cannot process non top-level $element');
+ }
+ sb.add(element.parseNode(compiler).unparse());
});
+ compiler.assembledCode = sb.toString();
} catch (BailoutException e) {
compiler.assembledCode = '''
main() {
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698