| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 sourceMapUri: extractUriOption(options, '--source-map='), | 59 sourceMapUri: extractUriOption(options, '--source-map='), |
| 60 outputUri: extractUriOption(options, '--out='), | 60 outputUri: extractUriOption(options, '--out='), |
| 61 terseDiagnostics: hasOption(options, '--terse'), | 61 terseDiagnostics: hasOption(options, '--terse'), |
| 62 dumpInfo: hasOption(options, '--dump-info'), | 62 dumpInfo: hasOption(options, '--dump-info'), |
| 63 buildId: extractStringOption( | 63 buildId: extractStringOption( |
| 64 options, '--build-id=', | 64 options, '--build-id=', |
| 65 "build number could not be determined"), | 65 "build number could not be determined"), |
| 66 showPackageWarnings: | 66 showPackageWarnings: |
| 67 hasOption(options, '--show-package-warnings'), | 67 hasOption(options, '--show-package-warnings'), |
| 68 useContentSecurityPolicy: hasOption(options, '--csp'), | 68 useContentSecurityPolicy: hasOption(options, '--csp'), |
| 69 hasIncrementalSupport: hasOption(options, '--incremental-support'), |
| 69 suppressWarnings: hasOption(options, '--suppress-warnings')) { | 70 suppressWarnings: hasOption(options, '--suppress-warnings')) { |
| 70 if (!libraryRoot.path.endsWith("/")) { | 71 if (!libraryRoot.path.endsWith("/")) { |
| 71 throw new ArgumentError("libraryRoot must end with a /"); | 72 throw new ArgumentError("libraryRoot must end with a /"); |
| 72 } | 73 } |
| 73 if (packageRoot != null && !packageRoot.path.endsWith("/")) { | 74 if (packageRoot != null && !packageRoot.path.endsWith("/")) { |
| 74 throw new ArgumentError("packageRoot must end with a /"); | 75 throw new ArgumentError("packageRoot must end with a /"); |
| 75 } | 76 } |
| 76 } | 77 } |
| 77 | 78 |
| 78 static String extractStringOption(List<String> options, | 79 static String extractStringOption(List<String> options, |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 330 } |
| 330 | 331 |
| 331 void diagnoseCrashInUserCode(String message, exception, stackTrace) { | 332 void diagnoseCrashInUserCode(String message, exception, stackTrace) { |
| 332 hasCrashed = true; | 333 hasCrashed = true; |
| 333 print('$message: ${tryToString(exception)}'); | 334 print('$message: ${tryToString(exception)}'); |
| 334 print(tryToString(stackTrace)); | 335 print(tryToString(stackTrace)); |
| 335 } | 336 } |
| 336 | 337 |
| 337 fromEnvironment(String name) => environment[name]; | 338 fromEnvironment(String name) => environment[name]; |
| 338 } | 339 } |
| OLD | NEW |