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

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: Updated cf. comments Created 7 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 | « pkg/async_helper/lib/async_helper.dart ('k') | sdk/lib/_internal/compiler/implementation/apiimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/compiler.dart
diff --git a/sdk/lib/_internal/compiler/compiler.dart b/sdk/lib/_internal/compiler/compiler.dart
index abeb36c459404f519ed5149807260d41ed4d8db8..215f248749e373a981a4d90e49b64be5ed20baaa 100644
--- a/sdk/lib/_internal/compiler/compiler.dart
+++ b/sdk/lib/_internal/compiler/compiler.dart
@@ -92,19 +92,21 @@ 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';
+ // TODO(ahe): Use the value of the future (which signals success or failure).
+ return compiler.run(script).then((_) {
+ 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;
+ });
}
/**
« no previous file with comments | « pkg/async_helper/lib/async_helper.dart ('k') | sdk/lib/_internal/compiler/implementation/apiimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698