fix: brown paper bag bug referencing the same object literal
[poolifier.git] / src / pools / abstract-pool.ts
index 32b4d983859c3f7fd0ce9354116ed9fcb5d05c53..3cb6c1f7a7b034086e6e20a56635c44f1d8af0f2 100644 (file)
@@ -2,7 +2,7 @@ import type {
   MessageValue,
   PromiseWorkerResponseWrapper
 } from '../utility-types'
-import { EMPTY_FUNCTION, EMPTY_OBJECT_LITERAL } from '../utils'
+import { EMPTY_FUNCTION } from '../utils'
 import { KillBehaviors, isKillBehavior } from '../worker/worker-options'
 import type { PoolOptions } from './pool'
 import { PoolEmitter } from './pool'
@@ -208,7 +208,7 @@ export abstract class AbstractPool<
     const res = this.internalExecute(worker, this.nextMessageId)
     this.checkAndEmitBusy()
     this.sendToWorker(worker, {
-      data: data ?? (EMPTY_OBJECT_LITERAL as Data),
+      data,
       id: this.nextMessageId
     })
     ++this.nextMessageId