| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 enableConcreteTypeInference: | 53 enableConcreteTypeInference: |
| 54 hasOption(options, '--enable-concrete-type-inference'), | 54 hasOption(options, '--enable-concrete-type-inference'), |
| 55 disableTypeInferenceFlag: | 55 disableTypeInferenceFlag: |
| 56 hasOption(options, '--disable-type-inference'), | 56 hasOption(options, '--disable-type-inference'), |
| 57 preserveComments: hasOption(options, '--preserve-comments'), | 57 preserveComments: hasOption(options, '--preserve-comments'), |
| 58 verbose: hasOption(options, '--verbose'), | 58 verbose: hasOption(options, '--verbose'), |
| 59 sourceMapUri: extractSourceMapUri(options), | 59 sourceMapUri: extractSourceMapUri(options), |
| 60 globalJsName: extractStringOption( | 60 globalJsName: extractStringOption( |
| 61 options, '--global-js-name=', r'$'), | 61 options, '--global-js-name=', r'$'), |
| 62 terseDiagnostics: hasOption(options, '--terse'), | 62 terseDiagnostics: hasOption(options, '--terse'), |
| 63 dumpInfo: hasOption(options, '--dump-info'), |
| 63 buildId: extractStringOption( | 64 buildId: extractStringOption( |
| 64 options, '--build-id=', | 65 options, '--build-id=', |
| 65 "build number could not be determined")) { | 66 "build number could not be determined")) { |
| 66 if (!libraryRoot.path.endsWith("/")) { | 67 if (!libraryRoot.path.endsWith("/")) { |
| 67 throw new ArgumentError("libraryRoot must end with a /"); | 68 throw new ArgumentError("libraryRoot must end with a /"); |
| 68 } | 69 } |
| 69 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 70 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
| 70 throw new ArgumentError("packageRoot must end with a /"); | 71 throw new ArgumentError("packageRoot must end with a /"); |
| 71 } | 72 } |
| 72 } | 73 } |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 328 } |
| 328 | 329 |
| 329 void diagnoseCrashInUserCode(String message, exception, stackTrace) { | 330 void diagnoseCrashInUserCode(String message, exception, stackTrace) { |
| 330 hasCrashed = true; | 331 hasCrashed = true; |
| 331 print('$message: ${tryToString(exception)}'); | 332 print('$message: ${tryToString(exception)}'); |
| 332 print(tryToString(stackTrace)); | 333 print(tryToString(stackTrace)); |
| 333 } | 334 } |
| 334 | 335 |
| 335 fromEnvironment(String name) => environment[name]; | 336 fromEnvironment(String name) => environment[name]; |
| 336 } | 337 } |
| OLD | NEW |