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

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: Code review change 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..66fe269bf397e4a686be7c24f8fcf805398f6fad 100644
--- a/frog/reader.dart
+++ b/frog/reader.dart
@@ -43,10 +43,17 @@ class LibraryReader {
}
}
- SourceFile readFile(String fullname) {
- var filename = _specialLibs[fullname];
+ SourceFile readFile(String 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;
+ filename = fullName;
}
if (world.files.fileExists(filename)) {

Powered by Google App Engine
This is Rietveld 408576698