diff options
author | Antoine du HAMEL <duhamelantoine1995@gmail.com> | 2019-05-02 18:57:06 -0400 |
---|---|---|
committer | ZYSzys <zyszys98@gmail.com> | 2019-05-14 16:17:34 +0800 |
commit | ac3b98cd265e3a9c94a9554a08d953da2a43c9b9 (patch) | |
tree | 333589a00540e51705732c4cdcb1acf6998a2cb7 /test/es-module | |
parent | 6fe369286a81fb4fc0190dc04ee16a466c7e0760 (diff) | |
download | android-node-v8-ac3b98cd265e3a9c94a9554a08d953da2a43c9b9.tar.gz android-node-v8-ac3b98cd265e3a9c94a9554a08d953da2a43c9b9.tar.bz2 android-node-v8-ac3b98cd265e3a9c94a9554a08d953da2a43c9b9.zip |
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
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>
Diffstat (limited to 'test/es-module')
-rw-r--r-- | test/es-module/test-esm-loader-cache-clearing.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/es-module/test-esm-loader-cache-clearing.js b/test/es-module/test-esm-loader-cache-clearing.js new file mode 100644 index 0000000000..ec22b6a6bb --- /dev/null +++ b/test/es-module/test-esm-loader-cache-clearing.js @@ -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'); |