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

Unified Diff: runtime/observatory/lib/src/elements/script_inset.dart

Issue 1447383002: Observatory: handle the case where package:foo imports are canonicalized as packages/foo. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/script_inset.dart
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index 9900117fde3491fe223ed573c09a82ee3781c2ef..9988ec99756e555626906189863ec475a0f96ea0 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -663,12 +663,24 @@ class ScriptInsetElement extends ObservatoryElement {
}
Library resolveDependency(String relativeUri) {
+ // This isn't really correct: we need to ask the embedder to do the
+ // uri canonicalization for us, but Observatory isn't in a position
+ // to invoke the library tag handler. Handle the most common cases.
var targetUri = Uri.parse(script.library.uri).resolve(relativeUri);
for (Library l in script.isolate.libraries) {
if (targetUri.toString() == l.uri) {
return l;
}
}
+ if (targetUri.scheme == 'package') {
floitsch 2015/11/17 01:42:31 I guess this will get worse when we have package-m
rmacnak 2015/11/17 01:53:07 Yeah. Maybe the flutter embedder could canonicaliz
+ targetUri = "packages/${targetUri.path}";
+ for (Library l in script.isolate.libraries) {
+ if (targetUri.toString() == l.uri) {
+ return l;
+ }
+ }
+ }
+
Logger.root.info("Could not resolve library dependency: $relativeUri");
return null;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698