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

Unified Diff: dart/frog/frog_leg.dart

Issue 10207010: Make dart2js work on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments 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
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/frog_leg.dart
diff --git a/dart/frog/frog_leg.dart b/dart/frog/frog_leg.dart
index 19faa3cf5ce2251bbfccd045d0496dfa380fb706..b905665814cc7b79f18cb9f62664175124aff8ec 100644
--- a/dart/frog/frog_leg.dart
+++ b/dart/frog/frog_leg.dart
@@ -10,42 +10,13 @@
#import('lang.dart', prefix: 'frog');
#import('../lib/compiler/compiler.dart', prefix: 'compiler');
#import('../lib/compiler/implementation/filenames.dart');
-
-String relativize(Uri base, Uri uri) {
- if (base.scheme == 'file' &&
- base.scheme == uri.scheme &&
- base.userInfo == uri.userInfo &&
- base.domain == uri.domain &&
- base.port == uri.port &&
- uri.query == "" && uri.fragment == "") {
- if (uri.path.startsWith(base.path)) {
- return uri.path.substring(base.path.length);
- }
- List<String> uriParts = uri.path.split('/');
- List<String> baseParts = base.path.split('/');
- int common = 0;
- int length = Math.min(uriParts.length, baseParts.length);
- while (common < length && uriParts[common] == baseParts[common]) {
- common++;
- }
- StringBuffer sb = new StringBuffer();
- for (int i = common + 1; i < baseParts.length; i++) {
- sb.add('../');
- }
- for (int i = common; i < uriParts.length - 1; i++) {
- sb.add('${uriParts[i]}/');
- }
- sb.add('${uriParts.last()}');
- return sb.toString();
- }
- return uri.toString();
-}
+#import('../lib/compiler/implementation/util/uri_extras.dart');
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: getCurrentDirectory());
+ Uri cwd = getCurrentDirectory();
Uri uri = cwd.resolve(nativeToUriPath(frog.options.dartScript));
String frogLibDir = nativeToUriPath(frog.options.libDir);
if (!frogLibDir.endsWith("/")) frogLibDir = "$frogLibDir/";
@@ -99,9 +70,3 @@ 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 | « no previous file | dart/lib/compiler/implementation/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698