| Index: pkg/compiler/lib/src/mirrors_used.dart
|
| diff --git a/pkg/compiler/lib/src/mirrors_used.dart b/pkg/compiler/lib/src/mirrors_used.dart
|
| index fac02346e9b381c2939054abc5deacef1fd154bc..553f9ccae6bfb8c38c2beb3b56ebd0c1041621cd 100644
|
| --- a/pkg/compiler/lib/src/mirrors_used.dart
|
| +++ b/pkg/compiler/lib/src/mirrors_used.dart
|
| @@ -28,6 +28,7 @@ import 'diagnostics/spannable.dart' show
|
| import 'elements/elements.dart' show
|
| ClassElement,
|
| Element,
|
| + ImportElement,
|
| LibraryElement,
|
| MetadataAnnotation,
|
| ScopeContainerElement,
|
| @@ -199,12 +200,10 @@ class MirrorUsageAnalyzer {
|
| new Map<LibraryElement, List<MirrorUsage>>();
|
| for (LibraryElement library in compiler.libraryLoader.libraries) {
|
| if (library.isInternalLibrary) continue;
|
| - for (LibraryTag tag in library.tags) {
|
| - Import importTag = tag.asImport();
|
| - if (importTag == null) continue;
|
| + for (ImportElement import in library.imports) {
|
| compiler.withCurrentElement(library, () {
|
| List<MirrorUsage> usages =
|
| - mirrorsUsedOnLibraryTag(library, importTag);
|
| + mirrorsUsedOnLibraryTag(library, import);
|
| if (usages != null) {
|
| List<MirrorUsage> existing = result[library];
|
| if (existing != null) {
|
| @@ -255,13 +254,13 @@ class MirrorUsageAnalyzer {
|
| /// Find @MirrorsUsed annotations on the given import [tag] in [library]. The
|
| /// annotations are represented as [MirrorUsage].
|
| List<MirrorUsage> mirrorsUsedOnLibraryTag(LibraryElement library,
|
| - Import tag) {
|
| - LibraryElement importedLibrary = library.getLibraryFromTag(tag);
|
| + ImportElement import) {
|
| + LibraryElement importedLibrary = import.importedLibrary;
|
| if (importedLibrary != compiler.mirrorsLibrary) {
|
| return null;
|
| }
|
| List<MirrorUsage> result = <MirrorUsage>[];
|
| - for (MetadataAnnotation metadata in tag.metadata) {
|
| + for (MetadataAnnotation metadata in import.metadata) {
|
| metadata.ensureResolved(compiler);
|
| ConstantValue value =
|
| compiler.constants.getConstantValue(metadata.constant);
|
| @@ -476,8 +475,8 @@ class MirrorUsageBuilder {
|
| LibraryElement libraryCandiate;
|
| String libraryNameCandiate;
|
| for (LibraryElement l in compiler.libraryLoader.libraries) {
|
| - if (l.hasLibraryName()) {
|
| - String libraryName = l.getLibraryOrScriptName();
|
| + if (l.hasLibraryName) {
|
| + String libraryName = l.libraryOrScriptName;
|
| if (string == libraryName) {
|
| // Found an exact match.
|
| libraryCandiate = l;
|
| @@ -535,7 +534,7 @@ class MirrorUsageBuilder {
|
| compiler.reportHint(
|
| spannable, MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
|
| {'name': identifiers[0],
|
| - 'library': library.getLibraryOrScriptName()});
|
| + 'library': library.libraryOrScriptName});
|
| } else {
|
| compiler.reportHint(
|
| spannable, MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT,
|
|
|