()
| 531 | } |
| 532 | |
| 533 | dispose(): void { |
| 534 | if (this.disposed) { |
| 535 | return |
| 536 | } |
| 537 | |
| 538 | this.disposed = true |
| 539 | if (!this.registered) { |
| 540 | this.deactivate() |
| 541 | return |
| 542 | } |
| 543 | |
| 544 | const payload = { |
| 545 | ...this.createEnvelope('hook:unregistered'), |
| 546 | ...this.createMetadataPayload(), |
| 547 | reason: 'disposed', |
| 548 | } as const |
| 549 | |
| 550 | emitAIDevtoolsEvent('hook:unregistered', payload) |
| 551 | |
| 552 | this.deactivate() |
| 553 | } |
| 554 | |
| 555 | private prepareForEmit(): boolean { |
| 556 | if (this.disposed || this.superseded) { |
nothing calls this directly
no test coverage detected