Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengbli committed Mar 24, 2016
1 parent d0545ff commit ddbfb7b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,11 +495,14 @@ namespace ts {
visitDirectory(path);
return result;
function visitDirectory(path: string) {
// This filtering is necessary because on some file system node fails to exclude
// "." and "..". See https://github.com/nodejs/node/issues/4002
const files = filter(<string[]>_fs.readdirSync(path || "."), f => f !== "." && f !== "..").sort();
const files = _fs.readdirSync(path || ".").sort();
const directories: string[] = [];
for (const current of files) {
// This is necessary because on some file system node fails to exclude
// "." and "..". See https://github.com/nodejs/node/issues/4002
if (current === "." || current === "..") {
continue;
}
const name = combinePaths(path, current);
if (!contains(exclude, getCanonicalPath(name))) {
const stat = _fs.statSync(name);
Expand Down

0 comments on commit ddbfb7b

Please sign in to comment.