diff --git a/lib/directory.js b/lib/directory.js index b353bae9..e1462492 100644 --- a/lib/directory.js +++ b/lib/directory.js @@ -5,7 +5,6 @@ const fs = require('fs-plus') const PathWatcher = require('pathwatcher') const File = require('./file') const {repoForPath} = require('./helpers') -const realpathCache = {} module.exports = class Directory { @@ -116,7 +115,7 @@ class Directory { this.lowerCaseRealPath = this.realPath.toLowerCase() } } else { - fs.realpath(this.path, realpathCache, (error, realPath) => { + fs.realpath(this.path, (error, realPath) => { // FIXME: Add actual error handling if (error || this.destroyed) return if (realPath && (realPath !== this.path)) { @@ -320,7 +319,7 @@ class Directory { // track the insertion index for the created views files.push(name) } else { - files.push(new File({name, fullPath, symlink, realpathCache, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat})) + files.push(new File({name, fullPath, symlink, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat})) } } } diff --git a/lib/file.js b/lib/file.js index 089ec4e6..8c26f2e8 100644 --- a/lib/file.js +++ b/lib/file.js @@ -4,7 +4,7 @@ const {repoForPath} = require('./helpers') module.exports = class File { - constructor ({name, fullPath, symlink, realpathCache, ignoredNames, useSyncFS, stats}) { + constructor ({name, fullPath, symlink, ignoredNames, useSyncFS, stats}) { this.name = name this.symlink = symlink this.ignoredNames = ignoredNames @@ -22,7 +22,7 @@ class File { if (useSyncFS) { this.realPath = fs.realpathSync(this.path) } else { - fs.realpath(this.path, realpathCache, (error, realPath) => { + fs.realpath(this.path, (error, realPath) => { // FIXME: Add actual error handling if (error || this.destroyed) return if (realPath && realPath !== this.path) {