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

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

Issue 675113002: Support async/await in the dart2js frontend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 6 years, 1 month 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/implementation/dart2js.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart2js.dart b/sdk/lib/_internal/compiler/implementation/dart2js.dart
index b0a760d5550f3a98a6f42fb6fa0d83e0844ac196..2359ad26a9f0182eaecb16939cdf43d008616389 100644
--- a/sdk/lib/_internal/compiler/implementation/dart2js.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart2js.dart
@@ -114,6 +114,7 @@ Future compile(List<String> argv) {
bool stripArgumentSet = false;
bool analyzeOnly = false;
bool analyzeAll = false;
+ bool enableAsyncAwait = false;
bool trustTypeAnnotations = false;
bool checkedMode = false;
// List of provided options that imply that output is expected.
@@ -189,6 +190,11 @@ Future compile(List<String> argv) {
passThrough(argument);
}
+ setEnableAsync(String argument) {
+ enableAsyncAwait = true;
+ passThrough(argument);
+ }
+
setVerbose(_) {
diagnosticHandler.verbose = true;
passThrough('--verbose');
@@ -317,6 +323,7 @@ Future compile(List<String> argv) {
(_) => hasDisallowUnsafeEval = true),
new OptionHandler('--show-package-warnings', passThrough),
new OptionHandler('--csp', passThrough),
+ new OptionHandler('--enable-async', setEnableAsync),
new OptionHandler('-D.+=.*', addInEnvironment),
// The following two options must come last.
@@ -377,6 +384,10 @@ Future compile(List<String> argv) {
api.Diagnostic.INFO);
}
if (analyzeAll) analyzeOnly = true;
+ if (enableAsyncAwait && !analyzeOnly) {
+ helpAndFail("Option '--enable-async' is currently only supported in "
+ "combination with the '--analyze-only' option.");
+ }
diagnosticHandler.info('Package root is $packageRoot');

Powered by Google App Engine
This is Rietveld 408576698