Skip to content

Commit 586ab5e

Browse files
committed
Disable FinalizationRegistry if NODE_V8_COVERAGE is set
Signed-off-by: Matteo Collina <hello@matteocollina.com>
1 parent 4013c4b commit 586ab5e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/compat/dispatcher-weakref.js

+8
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ class CompatFinalizer {
3131
}
3232

3333
module.exports = function () {
34+
// FIXME: remove workaround when the Node bug is fixed
35+
// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308
36+
if (process.env.NODE_V8_COVERAGE) {
37+
return {
38+
WeakRef: CompatWeakRef,
39+
FinalizationRegistry: CompatFinalizer
40+
}
41+
}
3442
return {
3543
WeakRef: global.WeakRef || CompatWeakRef,
3644
FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer

0 commit comments

Comments
 (0)