| 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 analyzer.file_system.memory_file_system; | 5 library analyzer.file_system.memory_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:core'; | 10 import 'dart:core'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 new HashMap<String, List<StreamController<WatchEvent>>>(); | 29 new HashMap<String, List<StreamController<WatchEvent>>>(); |
| 30 int nextStamp = 0; | 30 int nextStamp = 0; |
| 31 | 31 |
| 32 final pathos.Context _pathContext; | 32 final pathos.Context _pathContext; |
| 33 | 33 |
| 34 @override | 34 @override |
| 35 final AbsolutePathContext absolutePathContext; | 35 final AbsolutePathContext absolutePathContext; |
| 36 | 36 |
| 37 MemoryResourceProvider( | 37 MemoryResourceProvider( |
| 38 {pathos.Context context, @deprecated bool isWindows: false}) | 38 {pathos.Context context, @deprecated bool isWindows: false}) |
| 39 : _pathContext = (context ??= pathos.style == pathos.Style.windows | 39 : _pathContext = (context ??= pathos.context), |
| 40 // On Windows, ensure that the current drive matches | |
| 41 // the drive inserted by MemoryResourceProvider.convertPath | |
| 42 // so that packages are mapped to the correct drive | |
| 43 ? new pathos.Context(current: 'C:\\') | |
| 44 : pathos.context), | |
| 45 absolutePathContext = | 40 absolutePathContext = |
| 46 new AbsolutePathContext(context.style == pathos.Style.windows); | 41 new AbsolutePathContext(context.style == pathos.Style.windows); |
| 47 | 42 |
| 48 @override | 43 @override |
| 49 pathos.Context get pathContext => _pathContext; | 44 pathos.Context get pathContext => _pathContext; |
| 50 | 45 |
| 51 /** | 46 /** |
| 52 * Convert the given posix [path] to conform to this provider's path context. | 47 * Convert the given posix [path] to conform to this provider's path context. |
| 53 * | 48 * |
| 54 * This is a utility method for testing; paths passed in to other methods in | 49 * This is a utility method for testing; paths passed in to other methods in |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 } | 575 } |
| 581 return path == other.path; | 576 return path == other.path; |
| 582 } | 577 } |
| 583 | 578 |
| 584 @override | 579 @override |
| 585 String toString() => path; | 580 String toString() => path; |
| 586 | 581 |
| 587 @override | 582 @override |
| 588 Uri toUri() => _provider.pathContext.toUri(path); | 583 Uri toUri() => _provider.pathContext.toUri(path); |
| 589 } | 584 } |
| OLD | NEW |