OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 memory_file_system; | 5 library memory_file_system; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:core' hide Resource; | 9 import 'dart:core' hide Resource; |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 @override | 356 @override |
357 bool operator ==(other) { | 357 bool operator ==(other) { |
358 return other is _MemoryFileSource && other.id == id; | 358 return other is _MemoryFileSource && other.id == id; |
359 } | 359 } |
360 | 360 |
361 @override | 361 @override |
362 bool exists() => file.exists; | 362 bool exists() => file.exists; |
363 | 363 |
364 @override | 364 @override |
365 Uri resolveRelativeUri(Uri relativeUri) { | 365 Uri resolveRelativeUri(Uri relativeUri) { |
366 return uri.resolveUri(relativeUri); | 366 Uri baseUri = uri; |
| 367 String scheme = uri.scheme; |
| 368 if (scheme == DartUriResolver.DART_SCHEME) { |
| 369 String libraryName = uri.path; |
| 370 baseUri = Uri.parse('$scheme:$libraryName/$libraryName.dart'); |
| 371 } |
| 372 return baseUri.resolveUri(relativeUri); |
367 } | 373 } |
368 | 374 |
369 @override | 375 @override |
370 String toString() => file.toString(); | 376 String toString() => file.toString(); |
371 } | 377 } |
372 | 378 |
373 /** | 379 /** |
374 * An in-memory implementation of [Folder]. | 380 * An in-memory implementation of [Folder]. |
375 */ | 381 */ |
376 class _MemoryFolder extends _MemoryResource implements Folder { | 382 class _MemoryFolder extends _MemoryResource implements Folder { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 bool operator ==(other) { | 486 bool operator ==(other) { |
481 if (runtimeType != other.runtimeType) { | 487 if (runtimeType != other.runtimeType) { |
482 return false; | 488 return false; |
483 } | 489 } |
484 return path == other.path; | 490 return path == other.path; |
485 } | 491 } |
486 | 492 |
487 @override | 493 @override |
488 String toString() => path; | 494 String toString() => path; |
489 } | 495 } |
OLD | NEW |