(exportId: ExportId, refcount: number)
| 545 | } |
| 546 | |
| 547 | private releaseExport(exportId: ExportId, refcount: number) { |
| 548 | let entry = this.exports[exportId]; |
| 549 | if (!entry) { |
| 550 | throw new Error(`no such export ID: ${exportId}`); |
| 551 | } |
| 552 | if (entry.refcount < refcount) { |
| 553 | throw new Error(`refcount would go negative: ${entry.refcount} < ${refcount}`); |
| 554 | } |
| 555 | entry.refcount -= refcount; |
| 556 | if (entry.refcount === 0) { |
| 557 | delete this.exports[exportId]; |
| 558 | this.reverseExports.delete(entry.hook); |
| 559 | entry.hook.dispose(); |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | onSendError(error: Error): Error | void { |
| 564 | if (this.options.onSendError) { |
no test coverage detected