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

Side by Side Diff: pkg/analyzer/lib/file_system/physical_file_system.dart

Issue 2239303004: Normalize paths in PhysicalResourceProvider.getFile()/getFolder(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/builder.dart » ('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) 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.physical_file_system; 5 library analyzer.file_system.physical_file_system;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core' hide Resource; 8 import 'dart:core' hide Resource;
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 PhysicalResourceProvider(String fileReadMode(String s)) { 65 PhysicalResourceProvider(String fileReadMode(String s)) {
66 if (fileReadMode != null) { 66 if (fileReadMode != null) {
67 FileBasedSource.fileReadMode = fileReadMode; 67 FileBasedSource.fileReadMode = fileReadMode;
68 } 68 }
69 } 69 }
70 70
71 @override 71 @override
72 Context get pathContext => io.Platform.isWindows ? windows : posix; 72 Context get pathContext => io.Platform.isWindows ? windows : posix;
73 73
74 @override 74 @override
75 File getFile(String path) => new _PhysicalFile(new io.File(path)); 75 File getFile(String path) {
76 path = normalize(path);
Brian Wilkerson 2016/08/12 17:43:33 Should this be "pathContext.normalize()"?
scheglov 2016/08/12 18:02:50 It could be, but it does not have to. We has "pat
77 return new _PhysicalFile(new io.File(path));
78 }
76 79
77 @override 80 @override
78 Folder getFolder(String path) => new _PhysicalFolder(new io.Directory(path)); 81 Folder getFolder(String path) {
82 path = normalize(path);
83 return new _PhysicalFolder(new io.Directory(path));
84 }
79 85
80 @override 86 @override
81 Future<List<int>> getModificationTimes(List<Source> sources) async { 87 Future<List<int>> getModificationTimes(List<Source> sources) async {
82 List<String> paths = sources 88 List<String> paths = sources
83 .map((source) => source is FileBasedSource ? source.fullName : null) 89 .map((source) => source is FileBasedSource ? source.fullName : null)
84 .toList(); 90 .toList();
85 IsolateRunner runner = await pathsToTimesIsolateProvider.get(); 91 IsolateRunner runner = await pathsToTimesIsolateProvider.get();
86 return runner.run(_pathsToTimes, paths); 92 return runner.run(_pathsToTimes, paths);
87 } 93 }
88 94
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 timer.cancel(); 345 timer.cancel();
340 } 346 }
341 }); 347 });
342 return completer.future; 348 return completer.future;
343 } 349 }
344 _isSpawning = true; 350 _isSpawning = true;
345 _runner = await IsolateRunner.spawn(); 351 _runner = await IsolateRunner.spawn();
346 return _runner; 352 return _runner;
347 } 353 }
348 } 354 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/context/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698