| 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 * The library loader uses four different kinds of URIs in different parts of | 10 * The library loader uses four different kinds of URIs in different parts of |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 return compiler.withCurrentElement(library, () { | 332 return compiler.withCurrentElement(library, () { |
| 333 return registerLibraryFromTag(handler, library, tag); | 333 return registerLibraryFromTag(handler, library, tag); |
| 334 }); | 334 }); |
| 335 }); | 335 }); |
| 336 }); | 336 }); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void checkDuplicatedLibraryName(LibraryElement library) { | 339 void checkDuplicatedLibraryName(LibraryElement library) { |
| 340 LibraryName tag = library.libraryTag; | 340 LibraryName tag = library.libraryTag; |
| 341 if (tag != null) { | 341 if (tag != null) { |
| 342 String name = library.getLibraryOrScriptName(); | 342 String name = library.getLibraryName(); |
| 343 LibraryElement existing = | 343 LibraryElement existing = |
| 344 libraryNames.putIfAbsent(name, () => library); | 344 libraryNames.putIfAbsent(name, () => library); |
| 345 if (!identical(existing, library)) { | 345 if (!identical(existing, library)) { |
| 346 Uri uri = library.entryCompilationUnit.script.uri; | 346 Uri uri = library.entryCompilationUnit.script.uri; |
| 347 compiler.reportMessage( | 347 compiler.reportMessage( |
| 348 compiler.spanFromSpannable(tag.name, uri), | 348 compiler.spanFromSpannable(tag.name, uri), |
| 349 MessageKind.DUPLICATED_LIBRARY_NAME.error({'libraryName': name}), | 349 MessageKind.DUPLICATED_LIBRARY_NAME.error({'libraryName': name}), |
| 350 api.Diagnostic.WARNING); | 350 api.Diagnostic.WARNING); |
| 351 Uri existingUri = existing.entryCompilationUnit.script.uri; | 351 Uri existingUri = existing.entryCompilationUnit.script.uri; |
| 352 compiler.reportMessage( | 352 compiler.reportMessage( |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 } | 916 } |
| 917 | 917 |
| 918 /** | 918 /** |
| 919 * Registers all top-level entities of [library] as starting point for the | 919 * Registers all top-level entities of [library] as starting point for the |
| 920 * fixed-point computation of the import/export scopes. | 920 * fixed-point computation of the import/export scopes. |
| 921 */ | 921 */ |
| 922 void registerLibraryExports(LibraryElement library) { | 922 void registerLibraryExports(LibraryElement library) { |
| 923 nodeMap[library].registerInitialExports(); | 923 nodeMap[library].registerInitialExports(); |
| 924 } | 924 } |
| 925 } | 925 } |
| OLD | NEW |