Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 currently only supported with --analyze-only"); | |
|
floitsch
2014/11/03 17:55:54
--enable-async is currently ...
Johnni Winther
2014/11/04 12:24:33
Done.
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |