| 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 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import '../compiler_new.dart' as api; | 10 import '../compiler_new.dart' as api; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 leg.GenericTask userPackagesDiscoveryTask; | 41 leg.GenericTask userPackagesDiscoveryTask; |
| 42 | 42 |
| 43 Compiler(this.provider, | 43 Compiler(this.provider, |
| 44 api.CompilerOutput outputProvider, | 44 api.CompilerOutput outputProvider, |
| 45 this.handler, | 45 this.handler, |
| 46 this.libraryRoot, | 46 this.libraryRoot, |
| 47 this.packageRoot, | 47 this.packageRoot, |
| 48 List<String> options, | 48 List<String> options, |
| 49 this.environment, | 49 this.environment, |
| 50 [this.packageConfig, | 50 [this.packageConfig, |
| 51 this.packagesDiscoveryProvider]) | 51 this.packagesDiscoveryProvider, |
| 52 leg.Backend makeBackend(Compiler compiler)]) |
| 52 : this.options = options, | 53 : this.options = options, |
| 53 this.allowedLibraryCategories = getAllowedLibraryCategories(options), | 54 this.allowedLibraryCategories = getAllowedLibraryCategories(options), |
| 54 super( | 55 super( |
| 55 outputProvider: outputProvider, | 56 outputProvider: outputProvider, |
| 56 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), | 57 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), |
| 57 enableUserAssertions: hasOption(options, '--enable-checked-mode'), | 58 enableUserAssertions: hasOption(options, '--enable-checked-mode'), |
| 58 trustTypeAnnotations: | 59 trustTypeAnnotations: |
| 59 hasOption(options, '--trust-type-annotations'), | 60 hasOption(options, '--trust-type-annotations'), |
| 60 trustPrimitives: | 61 trustPrimitives: |
| 61 hasOption(options, '--trust-primitives'), | 62 hasOption(options, '--trust-primitives'), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 forceIncrementalSupport || | 99 forceIncrementalSupport || |
| 99 hasOption(options, '--incremental-support'), | 100 hasOption(options, '--incremental-support'), |
| 100 suppressWarnings: hasOption(options, '--suppress-warnings'), | 101 suppressWarnings: hasOption(options, '--suppress-warnings'), |
| 101 fatalWarnings: hasOption(options, '--fatal-warnings'), | 102 fatalWarnings: hasOption(options, '--fatal-warnings'), |
| 102 enableExperimentalMirrors: | 103 enableExperimentalMirrors: |
| 103 hasOption(options, '--enable-experimental-mirrors'), | 104 hasOption(options, '--enable-experimental-mirrors'), |
| 104 generateCodeWithCompileTimeErrors: | 105 generateCodeWithCompileTimeErrors: |
| 105 hasOption(options, '--generate-code-with-compile-time-errors'), | 106 hasOption(options, '--generate-code-with-compile-time-errors'), |
| 106 testMode: hasOption(options, '--test-mode'), | 107 testMode: hasOption(options, '--test-mode'), |
| 107 allowNativeExtensions: | 108 allowNativeExtensions: |
| 108 hasOption(options, '--allow-native-extensions')) { | 109 hasOption(options, '--allow-native-extensions'), |
| 110 makeBackend: makeBackend) { |
| 109 tasks.addAll([ | 111 tasks.addAll([ |
| 110 userHandlerTask = new leg.GenericTask('Diagnostic handler', this), | 112 userHandlerTask = new leg.GenericTask('Diagnostic handler', this), |
| 111 userProviderTask = new leg.GenericTask('Input provider', this), | 113 userProviderTask = new leg.GenericTask('Input provider', this), |
| 112 userPackagesDiscoveryTask = | 114 userPackagesDiscoveryTask = |
| 113 new leg.GenericTask('Package discovery', this), | 115 new leg.GenericTask('Package discovery', this), |
| 114 ]); | 116 ]); |
| 115 if (libraryRoot == null) { | 117 if (libraryRoot == null) { |
| 116 throw new ArgumentError("[libraryRoot] is null."); | 118 throw new ArgumentError("[libraryRoot] is null."); |
| 117 } | 119 } |
| 118 if (!libraryRoot.path.endsWith("/")) { | 120 if (!libraryRoot.path.endsWith("/")) { |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 print('$message: ${tryToString(exception)}'); | 480 print('$message: ${tryToString(exception)}'); |
| 479 print(tryToString(stackTrace)); | 481 print(tryToString(stackTrace)); |
| 480 } | 482 } |
| 481 | 483 |
| 482 fromEnvironment(String name) => environment[name]; | 484 fromEnvironment(String name) => environment[name]; |
| 483 | 485 |
| 484 LibraryInfo lookupLibraryInfo(String libraryName) { | 486 LibraryInfo lookupLibraryInfo(String libraryName) { |
| 485 return library_info.LIBRARIES[libraryName]; | 487 return library_info.LIBRARIES[libraryName]; |
| 486 } | 488 } |
| 487 } | 489 } |
| OLD | NEW |