mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(devtools): fix incorrect logic in destroy function for ChromeMessageBus
Destroy uses window.removeEventListener but the ChromeMessageBus doesn't actually depend on a window object.
In practice this code is unlikely to ever be reached. If a tab is closed the entire context script JS process is killed so this is not an bug that would be very common or even reachable. That being said for correctness this should not be using window.
(cherry picked from commit 36edf4870f)
This commit is contained in:
parent
244e0b0b59
commit
c7a18924a6
1 changed files with 1 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ export class ChromeMessageBus extends MessageBus<Events> {
|
|||
}
|
||||
|
||||
override destroy(): void {
|
||||
this._listeners.forEach((l) => window.removeEventListener('message', l));
|
||||
this._listeners.forEach((l) => this._port.onMessage.removeListener(l));
|
||||
this._listeners = [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue