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

Unified Diff: dart/lib/compiler/implementation/frog_leg.dart

Issue 9866006: Add library mapping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 9 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
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | dart/lib/compiler/implementation/io/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/frog_leg.dart
diff --git a/dart/lib/compiler/implementation/frog_leg.dart b/dart/lib/compiler/implementation/frog_leg.dart
index 42ea0cc6a5f9b20c1a3ba70b86b86d4f9639539c..0bebf49e22bbae0577b0a05c94861137e6daecb6 100644
--- a/dart/lib/compiler/implementation/frog_leg.dart
+++ b/dart/lib/compiler/implementation/frog_leg.dart
@@ -4,11 +4,12 @@
#library('frog_leg');
+#import('dart:io');
+
#import('../../uri/uri.dart');
#import('source_file.dart');
#import('../../../frog/lang.dart', prefix: 'frog');
#import('../compiler.dart', prefix: 'compiler');
-#import('io/io.dart', prefix: 'io');
String relativize(Uri base, Uri uri) {
if (base.scheme == 'file' &&
@@ -44,12 +45,12 @@ bool compile(frog.World world) {
final throwOnError = frog.options.throwOnErrors;
final showWarnings = frog.options.showWarnings;
final allowMockCompilation = frog.options.allowMockCompilation;
- Uri cwd = new Uri(scheme: 'file', path: io.getCurrentDirectory());
+ Uri cwd = new Uri(scheme: 'file', path: getCurrentDirectory());
Uri uri = cwd.resolve(frog.options.dartScript);
String frogLibDir = frog.options.libDir;
if (!frogLibDir.endsWith("/")) frogLibDir = "$frogLibDir/";
Uri frogLib = new Uri(scheme: 'file', path: frogLibDir);
- Uri libraryRoot = frogLib.resolve('../../lib/compiler/implementation/lib/');
+ Uri libraryRoot = frogLib.resolve('../../');
Map<String, SourceFile> sourceFiles = <SourceFile>{};
Future<String> provider(Uri uri) {
@@ -98,3 +99,9 @@ class AbortLeg {
AbortLeg(this.message);
toString() => 'Aborted due to --throw-on-error: $message';
}
+
+String getCurrentDirectory() {
+ String dir = new File(".").fullPathSync();
+ if (dir.endsWith("/")) return dir;
+ return "$dir/";
+}
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | dart/lib/compiler/implementation/io/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698