Chromium Code Reviews| Index: pkg/compiler/lib/src/apiimpl.dart |
| diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart |
| index ce3ec39b7a9d6a027fac88f5401e5c12bdf1c598..17912f694b06d60f11dc095766696488700a61a5 100644 |
| --- a/pkg/compiler/lib/src/apiimpl.dart |
| +++ b/pkg/compiler/lib/src/apiimpl.dart |
| @@ -191,10 +191,13 @@ class Compiler extends leg.Compiler { |
| // TODO(johnniwinther): Merge better with [translateDartUri] when |
| // [scanBuiltinLibrary] is removed. |
| - String lookupLibraryPath(LibraryInfo info) { |
| + String lookupLibraryPath(Uri uri, LibraryInfo info) { |
| if (info == null) return null; |
| if (!info.isDart2jsLibrary) return null; |
| - if (!allowedLibraryCategories.contains(info.category)) return null; |
| + if (!allowedLibraryCategories.contains(info.category)) { |
| + registerDisallowedLibraryUse(uri); |
| + return null; |
| + } |
| String path = info.dart2jsPath; |
| if (path == null) { |
| path = info.path; |
| @@ -316,7 +319,7 @@ class Compiler extends leg.Compiler { |
| Uri translateDartUri(elements.LibraryElement importingLibrary, |
| Uri resolvedUri, tree.Node node) { |
| LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path); |
| - String path = lookupLibraryPath(libraryInfo); |
| + String path = lookupLibraryPath(resolvedUri, libraryInfo); |
| if (libraryInfo != null && |
| libraryInfo.category == "Internal") { |
| bool allowInternalLibraryAccess = false; |
| @@ -344,8 +347,13 @@ class Compiler extends leg.Compiler { |
| } |
| } |
| if (path == null) { |
| - reportError(node, MessageKind.LIBRARY_NOT_FOUND, |
| - {'resolvedUri': resolvedUri}); |
| + if (libraryInfo == null) { |
|
sigurdm
2015/09/14 12:34:57
It would be nice to have another way than just ret
Johnni Winther
2015/09/14 13:23:39
Good point. Adding a TODO.
|
| + reportError(node, MessageKind.LIBRARY_NOT_FOUND, |
| + {'resolvedUri': resolvedUri}); |
| + } else { |
| + reportError(node, MessageKind.LIBRARY_NOT_SUPPORTED, |
| + {'resolvedUri': resolvedUri}); |
| + } |
| return null; |
| } |
| if (resolvedUri.path == 'html' || |