Skip to content
Permalink
Browse files

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: #25482

Backport-PR-URL: #27874
PR-URL: #25491
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information...
aduh95 authored and BethGriggs committed May 2, 2019
1 parent 819a647 commit cc3ca08046005c7440e934e644998ab3071a1386
Showing with 11 additions and 0 deletions.
  1. +11 −0 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');

0 comments on commit cc3ca08

Please sign in to comment.
You can’t perform that action at this time.