From d3adc16a08d95d6e331de55d7d3bf05a66a874a8 Mon Sep 17 00:00:00 2001 From: pack Date: Sun, 9 Aug 2026 10:54:08 +0000 Subject: stop tracking node_modules/ --- .../undici/lib/web/fetch/dispatcher-weakref.js | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 node_modules/undici/lib/web/fetch/dispatcher-weakref.js (limited to 'node_modules/undici/lib/web/fetch/dispatcher-weakref.js') diff --git a/node_modules/undici/lib/web/fetch/dispatcher-weakref.js b/node_modules/undici/lib/web/fetch/dispatcher-weakref.js deleted file mode 100644 index 6ac5f37..0000000 --- a/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict' - -const { kConnected, kSize } = require('../../core/symbols') - -class CompatWeakRef { - constructor (value) { - this.value = value - } - - deref () { - return this.value[kConnected] === 0 && this.value[kSize] === 0 - ? undefined - : this.value - } -} - -class CompatFinalizer { - constructor (finalizer) { - this.finalizer = finalizer - } - - register (dispatcher, key) { - if (dispatcher.on) { - dispatcher.on('disconnect', () => { - if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) { - this.finalizer(key) - } - }) - } - } - - unregister (key) {} -} - -module.exports = function () { - // FIXME: remove workaround when the Node bug is backported to v18 - // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 - if (process.env.NODE_V8_COVERAGE && process.version.startsWith('v18')) { - process._rawDebug('Using compatibility WeakRef and FinalizationRegistry') - return { - WeakRef: CompatWeakRef, - FinalizationRegistry: CompatFinalizer - } - } - return { WeakRef, FinalizationRegistry } -} -- cgit v1.2.3