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