| Index: compiler/java/com/google/dart/compiler/UrlLibrarySource.java
|
| diff --git a/compiler/java/com/google/dart/compiler/UrlLibrarySource.java b/compiler/java/com/google/dart/compiler/UrlLibrarySource.java
|
| index f5ec48ccdfdf055f3af8c54742e6abab4c292dca..e7622945632c5232339bff593a3c4d664437750c 100644
|
| --- a/compiler/java/com/google/dart/compiler/UrlLibrarySource.java
|
| +++ b/compiler/java/com/google/dart/compiler/UrlLibrarySource.java
|
| @@ -35,7 +35,7 @@ public class UrlLibrarySource extends UrlSource implements LibrarySource {
|
| }
|
| try {
|
| // Force the creation of an escaped relative URI to deal with spaces, etc.
|
| - URI uri = getUri().resolve(new URI(null, null, relPath, null, null)).normalize();
|
| + URI uri = getImportBaseUri().resolve(new URI(null, null, relPath, null, null)).normalize();
|
| String path = uri.getPath();
|
| // Resolve relative reference out of one system library into another
|
| if (PackageLibraryManager.isDartUri(uri)) {
|
| @@ -69,7 +69,7 @@ public class UrlLibrarySource extends UrlSource implements LibrarySource {
|
| }
|
| try {
|
| // Force the creation of an escaped relative URI to deal with spaces, etc.
|
| - URI uri = getUri().resolve(new URI(null, null, relPath, null, null)).normalize();
|
| + URI uri = getImportBaseUri().resolve(new URI(null, null, relPath, null, null)).normalize();
|
| if (PackageLibraryManager.isPackageUri(uri)) {
|
| URI fileUri = packageLibraryManager.resolveDartUri(uri);
|
| if (fileUri != null) {
|
| @@ -121,5 +121,13 @@ public class UrlLibrarySource extends UrlSource implements LibrarySource {
|
| String path = uri.getPath();
|
| return path == null || new File(path).exists();
|
| }
|
| -
|
| +
|
| + /**
|
| + * @return the {@link URI} to use as a base for resolving imports. Usually same as {@link #getUri()},
|
| + * but in case of Dart code in HTML may be mapped {@link URI}.
|
| + */
|
| + protected URI getImportBaseUri() {
|
| + return getUri();
|
| + }
|
| +
|
| }
|
|
|