Closed
Description
- Version: v14.2.0
- Platform: Darwin Kernel Version 19.4.0
- Subsystem: vm
What steps will reproduce the bug?
run this snippet with --experimental-vm-modules
const {SourceTextModule} = require('vm');
let grow = () => {
new SourceTextModule(`1 + 1`);
setTimeout(grow, 100)
}
grow()
How often does it reproduce? Is there a required condition?
Reproducible on every run on my machine.
What is the expected behavior?
SourceTextModule should be cleaned up by GC
What do you see instead?
The SourceTextModule instances never get cleaned up.
Additional information
I think issue is that ModuleWrap is used as a key in WeakMap in vm module, but I am not really familiar with this codebase.