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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * [CompilerTask] for loading libraries and setting up the import/export scopes. | 8 * [CompilerTask] for loading libraries and setting up the import/export scopes. |
9 */ | 9 */ |
10 abstract class LibraryLoader extends CompilerTask { | 10 abstract class LibraryLoader extends CompilerTask { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 void checkDuplicatedLibraryName(LibraryElement library) { | 219 void checkDuplicatedLibraryName(LibraryElement library) { |
220 LibraryName tag = library.libraryTag; | 220 LibraryName tag = library.libraryTag; |
221 if (tag != null) { | 221 if (tag != null) { |
222 String name = library.getLibraryOrScriptName(); | 222 String name = library.getLibraryOrScriptName(); |
223 LibraryElement existing = | 223 LibraryElement existing = |
224 libraryNames.putIfAbsent(name, () => library); | 224 libraryNames.putIfAbsent(name, () => library); |
225 if (!identical(existing, library)) { | 225 if (!identical(existing, library)) { |
226 Uri uri = library.entryCompilationUnit.script.uri; | 226 Uri uri = library.entryCompilationUnit.script.uri; |
227 compiler.reportMessage( | 227 compiler.reportMessage( |
228 compiler.spanFromNode(tag.name, uri), | 228 compiler.spanFromSpannable(tag.name, uri), |
229 MessageKind.DUPLICATED_LIBRARY_NAME.error([name]), | 229 MessageKind.DUPLICATED_LIBRARY_NAME.error([name]), |
230 api.Diagnostic.WARNING); | 230 api.Diagnostic.WARNING); |
231 Uri existingUri = existing.entryCompilationUnit.script.uri; | 231 Uri existingUri = existing.entryCompilationUnit.script.uri; |
232 compiler.reportMessage( | 232 compiler.reportMessage( |
233 compiler.spanFromNode(existing.libraryTag.name, existingUri), | 233 compiler.spanFromSpannable(existing.libraryTag.name, existingUri), |
234 MessageKind.DUPLICATED_LIBRARY_NAME.error([name]), | 234 MessageKind.DUPLICATED_LIBRARY_NAME.error([name]), |
235 api.Diagnostic.WARNING); | 235 api.Diagnostic.WARNING); |
236 } | 236 } |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 bool isDartCore(Uri uri) => uri.scheme == "dart" && uri.path == "core"; | 240 bool isDartCore(Uri uri) => uri.scheme == "dart" && uri.path == "core"; |
241 | 241 |
242 /** | 242 /** |
243 * Lazily loads and returns the [LibraryElement] for the dart:core library. | 243 * Lazily loads and returns the [LibraryElement] for the dart:core library. |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 } | 713 } |
714 | 714 |
715 /** | 715 /** |
716 * Registers all top-level entities of [library] as starting point for the | 716 * Registers all top-level entities of [library] as starting point for the |
717 * fixed-point computation of the import/export scopes. | 717 * fixed-point computation of the import/export scopes. |
718 */ | 718 */ |
719 void registerLibraryExports(LibraryElement library) { | 719 void registerLibraryExports(LibraryElement library) { |
720 nodeMap[library].registerInitialExports(); | 720 nodeMap[library].registerInitialExports(); |
721 } | 721 } |
722 } | 722 } |
OLD | NEW |