Skip to content

Commit 0b472a6

Browse files
committed
fixup! module: add clearCache for CJS and ESM
1 parent 933b744 commit 0b472a6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/api/module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2120,9 +2120,9 @@ returned object contains the following keys:
21202120
[`--enable-source-maps`]: cli.md#--enable-source-maps
21212121
[`--import`]: cli.md#--importmodule
21222122
[`--require`]: cli.md#-r---require-module
2123+
[`HostLoadImportedModule`]: https://tc39.es/ecma262/#sec-HostLoadImportedModule
21232124
[`NODE_COMPILE_CACHE=dir`]: cli.md#node_compile_cachedir
21242125
[`NODE_COMPILE_CACHE_PORTABLE=1`]: cli.md#node_compile_cache_portable1
2125-
[`HostLoadImportedModule`]: https://tc39.es/ecma262/#sec-HostLoadImportedModule
21262126
[`NODE_DISABLE_COMPILE_CACHE=1`]: cli.md#node_disable_compile_cache1
21272127
[`NODE_V8_COVERAGE=dir`]: cli.md#node_v8_coveragedir
21282128
[`SourceMap`]: #class-modulesourcemap

lib/internal/modules/clear.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function resolveClearCacheFilename(specifier, parentPath) {
111111
}
112112
request = fileURLToPath(parsedURL);
113113
} else {
114-
// Non-file URLs (e.g. virtual://) pass the href as-is
114+
// Non-file URLs (e.g. virtual://) - pass the href as-is
115115
// so that registered hooks can resolve them.
116116
request = parsedURL.href;
117117
}
@@ -125,7 +125,7 @@ function resolveClearCacheFilename(specifier, parentPath) {
125125
}
126126
return filename;
127127
} catch {
128-
// Resolution can fail for non-file specifiers without hooks return null
128+
// Resolution can fail for non-file specifiers without hooks - return null
129129
// to silently skip clearing rather than throwing.
130130
return null;
131131
}

0 commit comments

Comments
 (0)