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

Side by Side Diff: runtime/bin/path_impl.dart

Issue 10825434: Fix lowercasing output filenames for dart:3320 as well as fix for co19 test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added path length validation. Created 8 years, 3 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 | « lib/compiler/implementation/filenames.dart ('k') | tests/co19/co19-dart2js.status » ('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 class _Path implements Path { 5 class _Path implements Path {
6 final String _path; 6 final String _path;
7 7
8 const _Path(String source) : _path = source; 8 const _Path(String source) : _path = source;
9 _Path.fromNative(String source) : _path = _clean(source); 9 _Path.fromNative(String source) : _path = _clean(source);
10 10
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 segmentsToJoin.add(''); 157 segmentsToJoin.add('');
158 } 158 }
159 } 159 }
160 return new Path(Strings.join(segmentsToJoin, '/')); 160 return new Path(Strings.join(segmentsToJoin, '/'));
161 } 161 }
162 162
163 String toNativePath() { 163 String toNativePath() {
164 if (Platform.operatingSystem == 'windows') { 164 if (Platform.operatingSystem == 'windows') {
165 String nativePath = _path; 165 String nativePath = _path;
166 // Drop '/' before a drive letter. 166 // Drop '/' before a drive letter.
167 if (nativePath.startsWith('/') && nativePath[2] == ':') { 167 if (nativePath.length > 3 &&
168 nativePath.startsWith('/') &&
169 nativePath[2] == ':') {
168 nativePath = nativePath.substring(1); 170 nativePath = nativePath.substring(1);
169 } 171 }
170 nativePath = nativePath.replaceAll('/', '\\'); 172 nativePath = nativePath.replaceAll('/', '\\');
171 return nativePath; 173 return nativePath;
172 } 174 }
173 return _path; 175 return _path;
174 } 176 }
175 177
176 List<String> segments() { 178 List<String> segments() {
177 List result = _path.split('/'); 179 List result = _path.split('/');
(...skipping 30 matching lines...) Expand all
208 if (pos < 0) return new Path(''); 210 if (pos < 0) return new Path('');
209 while (pos > 0 && _path[pos - 1] == '/') --pos; 211 while (pos > 0 && _path[pos - 1] == '/') --pos;
210 return new Path((pos > 0) ? _path.substring(0, pos) : '/'); 212 return new Path((pos > 0) ? _path.substring(0, pos) : '/');
211 } 213 }
212 214
213 String get filename() { 215 String get filename() {
214 int pos = _path.lastIndexOf('/'); 216 int pos = _path.lastIndexOf('/');
215 return _path.substring(pos + 1); 217 return _path.substring(pos + 1);
216 } 218 }
217 } 219 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/filenames.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698