| 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 dart2js.compiler_base; | 5 library dart2js.compiler_base; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 EventSink, | 8 EventSink, |
| 9 Future; | 9 Future; |
| 10 | 10 |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 {'uri': uri, | 864 {'uri': uri, |
| 865 'importChain': importChains.join( | 865 'importChain': importChains.join( |
| 866 MessageTemplate.DISALLOWED_LIBRARY_IMPORT_PADDING)}); | 866 MessageTemplate.DISALLOWED_LIBRARY_IMPORT_PADDING)}); |
| 867 } | 867 } |
| 868 } | 868 } |
| 869 | 869 |
| 870 if (!loadedLibraries.containsLibrary(Uris.dart_core)) { | 870 if (!loadedLibraries.containsLibrary(Uris.dart_core)) { |
| 871 return null; | 871 return null; |
| 872 } | 872 } |
| 873 | 873 |
| 874 if (!enableExperimentalMirrors && | 874 bool importsMirrorsLibrary = |
| 875 loadedLibraries.containsLibrary(Uris.dart_mirrors)) { | 875 loadedLibraries.containsLibrary(Uris.dart_mirrors); |
| 876 if (importsMirrorsLibrary && !backend.supportsReflection) { |
| 876 Set<String> importChains = | 877 Set<String> importChains = |
| 877 computeImportChainsFor(loadedLibraries, Uris.dart_mirrors); | 878 computeImportChainsFor(loadedLibraries, Uris.dart_mirrors); |
| 878 if (!backend.supportsReflection) { | 879 reportErrorMessage( |
| 879 reportErrorMessage( | 880 NO_LOCATION_SPANNABLE, |
| 880 NO_LOCATION_SPANNABLE, | 881 MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND, |
| 881 MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND); | 882 {'importChain': importChains.join( |
| 882 } else { | 883 MessageTemplate.MIRRORS_NOT_SUPPORTED_BY_BACKEND_PADDING)}); |
| 883 reportWarningMessage( | 884 } else if (importsMirrorsLibrary && !enableExperimentalMirrors) { |
| 884 NO_LOCATION_SPANNABLE, | 885 Set<String> importChains = |
| 885 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, | 886 computeImportChainsFor(loadedLibraries, Uris.dart_mirrors); |
| 886 {'importChain': importChains.join( | 887 reportWarningMessage( |
| 887 MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)}); | 888 NO_LOCATION_SPANNABLE, |
| 888 } | 889 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, |
| 890 {'importChain': importChains.join( |
| 891 MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)}); |
| 889 } | 892 } |
| 890 | 893 |
| 891 functionClass.ensureResolved(this); | 894 functionClass.ensureResolved(this); |
| 892 functionApplyMethod = functionClass.lookupLocalMember('apply'); | 895 functionApplyMethod = functionClass.lookupLocalMember('apply'); |
| 893 | 896 |
| 894 if (preserveComments) { | 897 if (preserveComments) { |
| 895 return libraryLoader.loadLibrary(Uris.dart_mirrors) | 898 return libraryLoader.loadLibrary(Uris.dart_mirrors) |
| 896 .then((LibraryElement libraryElement) { | 899 .then((LibraryElement libraryElement) { |
| 897 documentClass = libraryElement.find('Comment'); | 900 documentClass = libraryElement.find('Comment'); |
| 898 }); | 901 }); |
| (...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 | 1853 |
| 1851 @override | 1854 @override |
| 1852 InterfaceType streamType([DartType elementType]) { | 1855 InterfaceType streamType([DartType elementType]) { |
| 1853 InterfaceType type = streamClass.computeType(compiler); | 1856 InterfaceType type = streamClass.computeType(compiler); |
| 1854 if (elementType == null) { | 1857 if (elementType == null) { |
| 1855 return streamClass.rawType; | 1858 return streamClass.rawType; |
| 1856 } | 1859 } |
| 1857 return type.createInstantiation([elementType]); | 1860 return type.createInstantiation([elementType]); |
| 1858 } | 1861 } |
| 1859 } | 1862 } |
| OLD | NEW |