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

Unified Diff: sdk/lib/_internal/compiler/compiler.dart

Issue 17759007: First pass at asynchronous input loading in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/_internal/compiler/compiler.dart
diff --git a/sdk/lib/_internal/compiler/compiler.dart b/sdk/lib/_internal/compiler/compiler.dart
index e0be2393bc5f6291533d9166f4c0c8f3841cae7e..bdbbd34fcd1ceb9f54943e0ad3320bf7f97cbe10 100644
--- a/sdk/lib/_internal/compiler/compiler.dart
+++ b/sdk/lib/_internal/compiler/compiler.dart
@@ -92,19 +92,20 @@ Future<String> compile(Uri script,
libraryRoot,
packageRoot,
options);
- compiler.run(script);
- String code = compiler.assembledCode;
- if (code != null && outputProvider != null) {
- String outputType = 'js';
- if (options.contains('--output-type=dart')) {
- outputType = 'dart';
+ return compiler.run(script).then((_) {
ahe 2013/06/26 07:02:00 Could you add something like: // TODO(ahe): Use t
Bob Nystrom 2013/06/27 00:38:18 Done.
+ String code = compiler.assembledCode;
+ if (code != null && outputProvider != null) {
+ String outputType = 'js';
+ if (options.contains('--output-type=dart')) {
+ outputType = 'dart';
+ }
+ outputProvider('', outputType)
+ ..add(code)
+ ..close();
+ code = ''; // Non-null signals success.
}
- outputProvider('', outputType)
- ..add(code)
- ..close();
- code = ''; // Non-null signals success.
- }
- return new Future.value(code);
+ return code;
+ });
}
/**

Powered by Google App Engine
This is Rietveld 408576698