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

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

Issue 10850015: Changed default Uri constructor to Uri.fromComponents(), new default constructor is Uri.fromString(… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/lib/uri/uri.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 17 matching lines...) Expand all
28 path = path.toLowerCase(); 28 path = path.toLowerCase();
29 if (path.length > 3 && path[0] == '/' && path[2] == ':') { 29 if (path.length > 3 && path[0] == '/' && path[2] == ':') {
30 return path.substring(1).replaceAll('/', '\\'); 30 return path.substring(1).replaceAll('/', '\\');
31 } else { 31 } else {
32 return path.replaceAll('/', '\\'); 32 return path.replaceAll('/', '\\');
33 } 33 }
34 } 34 }
35 35
36 Uri getCurrentDirectory() { 36 Uri getCurrentDirectory() {
37 final String dir = nativeToUriPath(new File('.').fullPathSync()); 37 final String dir = nativeToUriPath(new File('.').fullPathSync());
38 return new Uri(scheme: 'file', path: appendSlash(dir)); 38 return new Uri.fromComponents(scheme: 'file', path: appendSlash(dir));
39 } 39 }
40 40
41 String appendSlash(String path) => path.endsWith('/') ? path : '$path/'; 41 String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
OLDNEW
« no previous file with comments | « no previous file | dart/lib/uri/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698