| 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 'package:package_config/packages.dart'; | 10 import 'package:package_config/packages.dart'; |
| 11 import 'package:package_config/packages_file.dart' as pkgs; | 11 import 'package:package_config/packages_file.dart' as pkgs; |
| 12 import 'package:package_config/src/packages_impl.dart' | 12 import 'package:package_config/src/packages_impl.dart' |
| 13 show MapPackages, NonFilePackagesDirectoryPackages; | 13 show MapPackages, NonFilePackagesDirectoryPackages; |
| 14 import 'package:package_config/src/util.dart' show checkValidPackageUri; | 14 import 'package:package_config/src/util.dart' show checkValidPackageUri; |
| 15 | 15 |
| 16 import '../compiler_new.dart' as api; | 16 import '../compiler_new.dart' as api; |
| 17 import 'common/tasks.dart' show GenericTask; | 17 import 'common/tasks.dart' show GenericTask; |
| 18 import 'common.dart'; | 18 import 'common.dart'; |
| 19 import 'common/backend_api.dart' show |
| 20 Backend; |
| 19 import 'compiler.dart'; | 21 import 'compiler.dart'; |
| 20 import 'diagnostics/messages.dart' show Message; | 22 import 'diagnostics/messages.dart' show Message; |
| 21 import 'elements/elements.dart' as elements; | 23 import 'elements/elements.dart' as elements; |
| 22 import 'environment.dart'; | 24 import 'environment.dart'; |
| 23 import 'io/source_file.dart'; | 25 import 'io/source_file.dart'; |
| 24 import 'options.dart' show CompilerOptions; | 26 import 'options.dart' show CompilerOptions; |
| 25 import 'platform_configuration.dart' as platform_configuration; | 27 import 'platform_configuration.dart' as platform_configuration; |
| 26 import 'resolved_uri_translator.dart'; | 28 import 'resolved_uri_translator.dart'; |
| 27 import 'script.dart'; | 29 import 'script.dart'; |
| 28 | 30 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 | 41 |
| 40 ForwardingResolvedUriTranslator resolvedUriTranslator; | 42 ForwardingResolvedUriTranslator resolvedUriTranslator; |
| 41 | 43 |
| 42 GenericTask userHandlerTask; | 44 GenericTask userHandlerTask; |
| 43 GenericTask userProviderTask; | 45 GenericTask userProviderTask; |
| 44 GenericTask userPackagesDiscoveryTask; | 46 GenericTask userPackagesDiscoveryTask; |
| 45 | 47 |
| 46 Uri get libraryRoot => options.platformConfigUri.resolve("."); | 48 Uri get libraryRoot => options.platformConfigUri.resolve("."); |
| 47 | 49 |
| 48 CompilerImpl(this.provider, api.CompilerOutput outputProvider, this.handler, | 50 CompilerImpl(this.provider, api.CompilerOutput outputProvider, this.handler, |
| 49 CompilerOptions options) | 51 CompilerOptions options, |
| 52 {MakeBackendFuncion makeBackend, MakeReporterFunction makeReporter}) |
| 50 : resolvedUriTranslator = new ForwardingResolvedUriTranslator(), | 53 : resolvedUriTranslator = new ForwardingResolvedUriTranslator(), |
| 51 super( | 54 super( |
| 52 options: options, | 55 options: options, |
| 53 outputProvider: outputProvider, | 56 outputProvider: outputProvider, |
| 54 environment: new _Environment(options.environment)) { | 57 environment: new _Environment(options.environment), |
| 58 makeBackend: makeBackend, makeReporter: makeReporter) { |
| 55 _Environment env = environment; | 59 _Environment env = environment; |
| 56 env.compiler = this; | 60 env.compiler = this; |
| 57 tasks.addAll([ | 61 tasks.addAll([ |
| 58 userHandlerTask = new GenericTask('Diagnostic handler', this), | 62 userHandlerTask = new GenericTask('Diagnostic handler', this), |
| 59 userProviderTask = new GenericTask('Input provider', this), | 63 userProviderTask = new GenericTask('Input provider', this), |
| 60 userPackagesDiscoveryTask = new GenericTask('Package discovery', this), | 64 userPackagesDiscoveryTask = new GenericTask('Package discovery', this), |
| 61 ]); | 65 ]); |
| 62 } | 66 } |
| 63 | 67 |
| 64 void log(message) { | 68 void log(message) { |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 } | 353 } |
| 350 } | 354 } |
| 351 | 355 |
| 352 /// For every 'dart:' library, a corresponding environment variable is set | 356 /// For every 'dart:' library, a corresponding environment variable is set |
| 353 /// to "true". The environment variable's name is the concatenation of | 357 /// to "true". The environment variable's name is the concatenation of |
| 354 /// this prefix and the name (without the 'dart:'. | 358 /// this prefix and the name (without the 'dart:'. |
| 355 /// | 359 /// |
| 356 /// For example 'dart:html' has the environment variable 'dart.library.html' set | 360 /// For example 'dart:html' has the environment variable 'dart.library.html' set |
| 357 /// to "true". | 361 /// to "true". |
| 358 const String _dartLibraryEnvironmentPrefix = 'dart.library.'; | 362 const String _dartLibraryEnvironmentPrefix = 'dart.library.'; |
| OLD | NEW |