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

Commit 208d0bb

Browse files
author
Winston Liu
authored
Merge pull request #1269 from atom/wl-rm-realpath-cache
Remove realpathCache argument in fs.realpath
2 parents aab456b + f4be1fc commit 208d0bb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/directory.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const fs = require('fs-plus')
55
const PathWatcher = require('pathwatcher')
66
const File = require('./file')
77
const {repoForPath} = require('./helpers')
8-
const realpathCache = {}
98

109
module.exports =
1110
class Directory {
@@ -116,7 +115,7 @@ class Directory {
116115
this.lowerCaseRealPath = this.realPath.toLowerCase()
117116
}
118117
} else {
119-
fs.realpath(this.path, realpathCache, (error, realPath) => {
118+
fs.realpath(this.path, (error, realPath) => {
120119
// FIXME: Add actual error handling
121120
if (error || this.destroyed) return
122121
if (realPath && (realPath !== this.path)) {
@@ -320,7 +319,7 @@ class Directory {
320319
// track the insertion index for the created views
321320
files.push(name)
322321
} else {
323-
files.push(new File({name, fullPath, symlink, realpathCache, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
322+
files.push(new File({name, fullPath, symlink, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
324323
}
325324
}
326325
}

lib/file.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {repoForPath} = require('./helpers')
44

55
module.exports =
66
class File {
7-
constructor ({name, fullPath, symlink, realpathCache, ignoredNames, useSyncFS, stats}) {
7+
constructor ({name, fullPath, symlink, ignoredNames, useSyncFS, stats}) {
88
this.name = name
99
this.symlink = symlink
1010
this.ignoredNames = ignoredNames
@@ -22,7 +22,7 @@ class File {
2222
if (useSyncFS) {
2323
this.realPath = fs.realpathSync(this.path)
2424
} else {
25-
fs.realpath(this.path, realpathCache, (error, realPath) => {
25+
fs.realpath(this.path, (error, realPath) => {
2626
// FIXME: Add actual error handling
2727
if (error || this.destroyed) return
2828
if (realPath && realPath !== this.path) {

0 commit comments

Comments
 (0)