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

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

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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
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 _Path(String source) : _path = source; 8 _Path(String source) : _path = source;
9 _Path.fromNative(String source) : _path = _clean(source); 9 _Path.fromNative(String source) : _path = _clean(source);
10 10
11 int hashCode() => _path.hashCode(); 11 int get hashCode => _path.hashCode;
12 12
13 static String _clean(String source) { 13 static String _clean(String source) {
14 switch (Platform.operatingSystem) { 14 switch (Platform.operatingSystem) {
15 case 'windows': 15 case 'windows':
16 return _cleanWindows(source); 16 return _cleanWindows(source);
17 default: 17 default:
18 return source; 18 return source;
19 } 19 }
20 } 20 }
21 21
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (pos < 0) return new Path(''); 234 if (pos < 0) return new Path('');
235 while (pos > 0 && _path[pos - 1] == '/') --pos; 235 while (pos > 0 && _path[pos - 1] == '/') --pos;
236 return new Path((pos > 0) ? _path.substring(0, pos) : '/'); 236 return new Path((pos > 0) ? _path.substring(0, pos) : '/');
237 } 237 }
238 238
239 String get filename { 239 String get filename {
240 int pos = _path.lastIndexOf('/'); 240 int pos = _path.lastIndexOf('/');
241 return _path.substring(pos + 1); 241 return _path.substring(pos + 1);
242 } 242 }
243 } 243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698