Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use local const instead of property on Module object
  • Loading branch information
addaleax committed Sep 10, 2016
commit 7f0c2245355311b14b47e2e6f735811c363660f8
4 changes: 2 additions & 2 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function tryPackage(requestPath, exts, isMain) {
// In order to minimize unnecessary lstat() calls,
// this cache is a list of known-real paths.
// Set to an empty object to reset.
Module._realpathCache = new Map();
const realpathCache = new Map();

const realpathCacheKey = fs.realpathCacheKey;
delete fs.realpathCacheKey;
Expand All @@ -131,7 +131,7 @@ function tryFile(requestPath, isMain) {

function toRealPath(requestPath) {
return fs.realpathSync(requestPath, {
[realpathCacheKey]: Module._realpathCache
[realpathCacheKey]: realpathCache
});
}

Expand Down