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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 /// If [skipLibraryWithPartOfTag] is `true`, member analysis is skipped if the | 955 /// If [skipLibraryWithPartOfTag] is `true`, member analysis is skipped if the |
956 /// library has a `part of` tag, assuming it is a part and not a library. | 956 /// library has a `part of` tag, assuming it is a part and not a library. |
957 /// | 957 /// |
958 /// This operation assumes an unclosed resolution queue and is only supported | 958 /// This operation assumes an unclosed resolution queue and is only supported |
959 /// when the '--analyze-main' option is used. | 959 /// when the '--analyze-main' option is used. |
960 Future<LibraryElement> analyzeUri( | 960 Future<LibraryElement> analyzeUri( |
961 Uri libraryUri, | 961 Uri libraryUri, |
962 {bool skipLibraryWithPartOfTag: true}) { | 962 {bool skipLibraryWithPartOfTag: true}) { |
963 assert(analyzeMain); | 963 assert(analyzeMain); |
964 reporter.log('Analyzing $libraryUri ($buildId)'); | 964 reporter.log('Analyzing $libraryUri ($buildId)'); |
965 return libraryLoader.loadLibrary(libraryUri).then((LibraryElement library) { | 965 return libraryLoader.loadLibrary( |
966 var compilationUnit = library.compilationUnit; | 966 libraryUri, skipFileWithPartOfTag: true).then( |
967 if (skipLibraryWithPartOfTag && compilationUnit.partTag != null) { | 967 (LibraryElement library) { |
968 return null; | 968 if (library == null) return null; |
969 } | |
970 fullyEnqueueLibrary(library, enqueuer.resolution); | 969 fullyEnqueueLibrary(library, enqueuer.resolution); |
971 emptyQueue(enqueuer.resolution); | 970 emptyQueue(enqueuer.resolution); |
972 enqueuer.resolution.logSummary(reporter.log); | 971 enqueuer.resolution.logSummary(reporter.log); |
973 return library; | 972 return library; |
974 }); | 973 }); |
975 } | 974 } |
976 | 975 |
977 /// Performs the compilation when all libraries have been loaded. | 976 /// Performs the compilation when all libraries have been loaded. |
978 void compileLoadedLibraries() { | 977 void compileLoadedLibraries() { |
979 computeMain(); | 978 computeMain(); |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 if (_otherDependencies == null) { | 2188 if (_otherDependencies == null) { |
2190 _otherDependencies = new Setlet<Element>(); | 2189 _otherDependencies = new Setlet<Element>(); |
2191 } | 2190 } |
2192 _otherDependencies.add(element.implementation); | 2191 _otherDependencies.add(element.implementation); |
2193 } | 2192 } |
2194 | 2193 |
2195 Iterable<Element> get otherDependencies { | 2194 Iterable<Element> get otherDependencies { |
2196 return _otherDependencies != null ? _otherDependencies : const <Element>[]; | 2195 return _otherDependencies != null ? _otherDependencies : const <Element>[]; |
2197 } | 2196 } |
2198 } | 2197 } |
OLD | NEW |