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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/apiimpl.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library leg_apiimpl; 5 library leg_apiimpl;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import '../compiler.dart' as api; 9 import '../compiler.dart' as api;
10 import 'dart2jslib.dart' as leg; 10 import 'dart2jslib.dart' as leg;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 dumpInfo: hasOption(options, '--dump-info'), 70 dumpInfo: hasOption(options, '--dump-info'),
71 buildId: extractStringOption( 71 buildId: extractStringOption(
72 options, '--build-id=', 72 options, '--build-id=',
73 "build number could not be determined"), 73 "build number could not be determined"),
74 showPackageWarnings: 74 showPackageWarnings:
75 hasOption(options, '--show-package-warnings'), 75 hasOption(options, '--show-package-warnings'),
76 useContentSecurityPolicy: hasOption(options, '--csp'), 76 useContentSecurityPolicy: hasOption(options, '--csp'),
77 hasIncrementalSupport: 77 hasIncrementalSupport:
78 forceIncrementalSupport || 78 forceIncrementalSupport ||
79 hasOption(options, '--incremental-support'), 79 hasOption(options, '--incremental-support'),
80 suppressWarnings: hasOption(options, '--suppress-warnings')) { 80 suppressWarnings: hasOption(options, '--suppress-warnings'),
81 enableAsyncAwait: hasOption(options, '--enable-async')) {
81 tasks.addAll([ 82 tasks.addAll([
82 userHandlerTask = new leg.GenericTask('Diagnostic handler', this), 83 userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
83 userProviderTask = new leg.GenericTask('Input provider', this), 84 userProviderTask = new leg.GenericTask('Input provider', this),
84 ]); 85 ]);
85 if (!libraryRoot.path.endsWith("/")) { 86 if (!libraryRoot.path.endsWith("/")) {
86 throw new ArgumentError("libraryRoot must end with a /"); 87 throw new ArgumentError("libraryRoot must end with a /");
87 } 88 }
88 if (packageRoot != null && !packageRoot.path.endsWith("/")) { 89 if (packageRoot != null && !packageRoot.path.endsWith("/")) {
89 throw new ArgumentError("packageRoot must end with a /"); 90 throw new ArgumentError("packageRoot must end with a /");
90 } 91 }
92 if (enableAsyncAwait && !analyzeOnly) {
93 throw new ArgumentError(
94 "--enable-async is currently only supported with --analyze-only");
95 }
91 } 96 }
92 97
93 static String extractStringOption(List<String> options, 98 static String extractStringOption(List<String> options,
94 String prefix, 99 String prefix,
95 String defaultValue) { 100 String defaultValue) {
96 for (String option in options) { 101 for (String option in options) {
97 if (option.startsWith(prefix)) { 102 if (option.startsWith(prefix)) {
98 return option.substring(prefix.length); 103 return option.substring(prefix.length);
99 } 104 }
100 } 105 }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 354 }
350 355
351 void diagnoseCrashInUserCode(String message, exception, stackTrace) { 356 void diagnoseCrashInUserCode(String message, exception, stackTrace) {
352 hasCrashed = true; 357 hasCrashed = true;
353 print('$message: ${tryToString(exception)}'); 358 print('$message: ${tryToString(exception)}');
354 print(tryToString(stackTrace)); 359 print(tryToString(stackTrace));
355 } 360 }
356 361
357 fromEnvironment(String name) => environment[name]; 362 fromEnvironment(String name) => environment[name];
358 } 363 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698