Skip to content

Commit 512210f

Browse files
committed
fixup: address comment
1 parent fdbf472 commit 512210f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/modules/cjs/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ let requireDepth = 0;
8888
let statCache = new Map();
8989
function stat(filename) {
9090
filename = path.toNamespacedPath(filename);
91-
if (statCache === null) statCache = new Map();
9291
let result = statCache.get(filename);
9392
if (result !== undefined) return result;
9493
result = internalModuleStat(filename);
@@ -800,6 +799,7 @@ Module.prototype._compile = function(content, filename) {
800799
var exports = this.exports;
801800
var thisValue = exports;
802801
var module = this;
802+
if (statCache === null) statCache = new Map();
803803
if (inspectorWrapper) {
804804
result = inspectorWrapper(compiledWrapper, thisValue, exports,
805805
require, module, filename, dirname);

0 commit comments

Comments
 (0)