| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library('dart2js'); | 5 #library('dart2js'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 #import('dart:uri'); |
| 8 #import('dart:utf'); | 9 #import('dart:utf'); |
| 9 | 10 |
| 10 #import('../../uri/uri.dart'); | |
| 11 #import('../compiler.dart', prefix: 'api'); | 11 #import('../compiler.dart', prefix: 'api'); |
| 12 #import('colors.dart'); | 12 #import('colors.dart'); |
| 13 #import('source_file.dart'); | 13 #import('source_file.dart'); |
| 14 | 14 |
| 15 String relativize(Uri base, Uri uri) { | 15 String relativize(Uri base, Uri uri) { |
| 16 if (base.scheme == 'file' && | 16 if (base.scheme == 'file' && |
| 17 base.scheme == uri.scheme && | 17 base.scheme == uri.scheme && |
| 18 base.userInfo == uri.userInfo && | 18 base.userInfo == uri.userInfo && |
| 19 base.domain == uri.domain && | 19 base.domain == uri.domain && |
| 20 base.port == uri.port && | 20 base.port == uri.port && |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 var bytes = file.readListSync(buffer, 0, length); | 149 var bytes = file.readListSync(buffer, 0, length); |
| 150 file.closeSync(); | 150 file.closeSync(); |
| 151 return new String.fromCharCodes(new Utf8Decoder(buffer).decodeRest()); | 151 return new String.fromCharCodes(new Utf8Decoder(buffer).decodeRest()); |
| 152 } | 152 } |
| 153 | 153 |
| 154 String getCurrentDirectory() { | 154 String getCurrentDirectory() { |
| 155 String dir = new File(".").fullPathSync(); | 155 String dir = new File(".").fullPathSync(); |
| 156 if (dir.endsWith("/")) return dir; | 156 if (dir.endsWith("/")) return dir; |
| 157 return "$dir/"; | 157 return "$dir/"; |
| 158 } | 158 } |
| OLD | NEW |