mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: clearing require cache crashes esm loader
This test shows the regression introduced in v11.4.0: clearing out the require.cache crashes node when using the `--experimental-modules` flag. Refs: https://github.com/nodejs/node/issues/25482 Backport-PR-URL: https://github.com/nodejs/node/pull/27874 PR-URL: https://github.com/nodejs/node/pull/25491 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
819a647d8f
commit
cc3ca08046
1 file changed
+11
@@ -0,0 +1,11 @@
|
||||
// Flags: --experimental-modules
|
||||
'use strict';
|
||||
require('../common');
|
||||
|
||||
const { cache } = require;
|
||||
|
||||
Object.keys(cache).forEach((key) => {
|
||||
delete cache[key];
|
||||
});
|
||||
// Require the same module again triggers the crash
|
||||
require('../common');
|
||||
Reference in new issue
Block a user