Skip to content

Commit

Permalink
test: clearing require cache crashes esm loader
Browse files Browse the repository at this point in the history
This test shows the regression introduced in v11.4.0: clearing out the
require.cache crashes node when using the `--experimental-modules` flag.
Refs: nodejs#25482
  • Loading branch information
aduh95 authored and ZYSzys committed May 13, 2019
1 parent 85891a0 commit 243600a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/known_issues/test-esm-loader-cache-clearing.js
Original file line number Diff line number Diff line change
@@ -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 243600a

Please sign in to comment.