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

Side by Side Diff: dart/lib/compiler/implementation/filenames.dart

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 filenames; 5 #library('filenames');
6 6
7 import 'dart:io'; 7 #import('dart:io');
8 import 'dart:uri'; 8 #import('dart:uri');
9 9
10 // TODO(ahe): This library should be replaced by a general 10 // TODO(ahe): This library should be replaced by a general
11 // path-munging library. 11 // path-munging library.
12 // 12 //
13 // See also: 13 // See also:
14 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx 14 // http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx
15 15
16 String nativeToUriPath(String filename) { 16 String nativeToUriPath(String filename) {
17 return new Path.fromNative(filename).toString(); 17 return new Path.fromNative(filename).toString();
18 } 18 }
19 19
20 String uriPathToNative(String path) { 20 String uriPathToNative(String path) {
21 return new Path(path).toNativePath(); 21 return new Path(path).toNativePath();
22 } 22 }
23 23
24 Uri getCurrentDirectory() { 24 Uri getCurrentDirectory() {
25 final String dir = nativeToUriPath(new File('.').fullPathSync()); 25 final String dir = nativeToUriPath(new File('.').fullPathSync());
26 return new Uri.fromComponents(scheme: 'file', path: appendSlash(dir)); 26 return new Uri.fromComponents(scheme: 'file', path: appendSlash(dir));
27 } 27 }
28 28
29 String appendSlash(String path) => path.endsWith('/') ? path : '$path/'; 29 String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/enqueue.dart ('k') | dart/lib/compiler/implementation/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698