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

Unified Diff: frog/reader.dart

Issue 10032015: Add support for the package: directive in Frog and dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months 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
Index: frog/reader.dart
diff --git a/frog/reader.dart b/frog/reader.dart
index 222fca254e6ecd58b645dc082dd348d2a0a4c699..2f2117909806c09449c439007b568b8c3c53cdbb 100644
--- a/frog/reader.dart
+++ b/frog/reader.dart
@@ -44,7 +44,14 @@ class LibraryReader {
}
SourceFile readFile(String fullname) {
Bob Nystrom 2012/04/09 23:54:08 Should be "fullName".
nweiz 2012/04/10 00:16:31 Done.
- var filename = _specialLibs[fullname];
+ String filename;
+ if (fullname.startsWith('package:')) {
+ filename = joinPaths(dirname(options.dartScript),
+ joinPaths('packages', fullname.substring('package:'.length)));
+ } else {
+ filename = _specialLibs[fullname];
+ }
+
if (filename == null) {
filename = fullname;
}

Powered by Google App Engine
This is Rietveld 408576698