Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: compiler/java/com/google/dart/compiler/UrlLibrarySource.java

Issue 11348291: Analyze Dart scripts in HTML files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Analyze in builder thread Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/META-INF/MANIFEST.MF » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
+
}
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/META-INF/MANIFEST.MF » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698