(code, customErr, customErrReason)
| 391 | } |
| 392 | |
| 393 | [kOnExit](code, customErr, customErrReason) { |
| 394 | debug(`[${threadId}] hears end event for Worker ${this.threadId}`); |
| 395 | drainMessagePort(this[kPublicPort]); |
| 396 | drainMessagePort(this[kPort]); |
| 397 | destroyMainThreadPort(this.threadId); |
| 398 | this.removeAllListeners('message'); |
| 399 | this.removeAllListeners('messageerrors'); |
| 400 | this[kPublicPort].unref(); |
| 401 | this[kPort].unref(); |
| 402 | this[kDispose](); |
| 403 | if (customErr) { |
| 404 | debug(`[${threadId}] failing with custom error ${customErr} \ |
| 405 | and with reason ${customErrReason}`); |
| 406 | this.emit('error', new errorCodes[customErr](customErrReason)); |
| 407 | } |
| 408 | this.emit('exit', code); |
| 409 | this.removeAllListeners(); |
| 410 | } |
| 411 | |
| 412 | [kOnCouldNotSerializeErr]() { |
| 413 | this.emit('error', new ERR_WORKER_UNSERIALIZABLE_ERROR()); |
nothing calls this directly
no test coverage detected