Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Remove realpathCache argument in fs.realpath #1269

Merged
merged 2 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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}))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down