| Index: pkg/analyzer/lib/file_system/memory_file_system.dart
|
| diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
|
| index da68f08c0ee42136a537e21a64155d4083a1e921..e5def6a28da74985aaef2e78314388300bf2a4b3 100644
|
| --- a/pkg/analyzer/lib/file_system/memory_file_system.dart
|
| +++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
|
| @@ -110,17 +110,6 @@ class MemoryResourceProvider implements ResourceProvider {
|
| return file;
|
| }
|
|
|
| - File updateFile(String path, String content, [int stamp]) {
|
| - path = posix.normalize(path);
|
| - newFolder(posix.dirname(path));
|
| - _MemoryFile file = new _MemoryFile(this, path);
|
| - _pathToResource[path] = file;
|
| - _pathToContent[path] = content;
|
| - _pathToTimestamp[path] = stamp != null ? stamp : nextStamp++;
|
| - _notifyWatchers(path, ChangeType.MODIFY);
|
| - return file;
|
| - }
|
| -
|
| Folder newFolder(String path) {
|
| path = posix.normalize(path);
|
| if (!path.startsWith('/')) {
|
| @@ -145,6 +134,17 @@ class MemoryResourceProvider implements ResourceProvider {
|
| }
|
| }
|
|
|
| + File updateFile(String path, String content, [int stamp]) {
|
| + path = posix.normalize(path);
|
| + newFolder(posix.dirname(path));
|
| + _MemoryFile file = new _MemoryFile(this, path);
|
| + _pathToResource[path] = file;
|
| + _pathToContent[path] = content;
|
| + _pathToTimestamp[path] = stamp != null ? stamp : nextStamp++;
|
| + _notifyWatchers(path, ChangeType.MODIFY);
|
| + return file;
|
| + }
|
| +
|
| void _checkFileAtPath(String path) {
|
| _MemoryResource resource = _pathToResource[path];
|
| if (resource is! _MemoryFile) {
|
| @@ -398,6 +398,9 @@ class _MemoryFolder extends _MemoryResource implements Folder {
|
|
|
| @override
|
| List<Resource> getChildren() {
|
| + if (!exists) {
|
| + throw new FileSystemException(path, 'Folder does not exist.');
|
| + }
|
| List<Resource> children = <Resource>[];
|
| _provider._pathToResource.forEach((resourcePath, resource) {
|
| if (posix.dirname(resourcePath) == path) {
|
|
|