mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
ac3b98cd26
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 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>
12 lines
235 B
JavaScript
12 lines
235 B
JavaScript
// 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');
|