diff --git a/lib/handler/decorator-handler.js b/lib/handler/decorator-handler.js index 9d2c4d0a34d..b0966c2eca9 100644 --- a/lib/handler/decorator-handler.js +++ b/lib/handler/decorator-handler.js @@ -1,11 +1,9 @@ 'use strict' const assert = require('node:assert') -const noop = () => {} module.exports = class DecoratorHandler { #handler - #onConnectCalled = false #onCompleteCalled = false #onErrorCalled = false @@ -17,16 +15,10 @@ module.exports = class DecoratorHandler { } onConnect (...args) { - this.#onConnectCalled = true return this.#handler.onConnect?.(...args) } onError (...args) { - if (!this.#onConnectCalled) { - this.#onConnectCalled = true - this.#handler.onConnect?.(noop) - } - this.#onErrorCalled = true return this.#handler.onError?.(...args) }