fix(PostMessageBus):Add the worker scope to please Closure
This commit is contained in:
parent
f4f6b8721a
commit
f2809d1ed8
|
@ -66,7 +66,8 @@ export class PostMessageBusSource implements MessageBusSource {
|
||||||
eventTarget.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
|
eventTarget.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
|
||||||
} else {
|
} else {
|
||||||
// if no eventTarget is given we assume we're in a WebWorker and listen on the global scope
|
// if no eventTarget is given we assume we're in a WebWorker and listen on the global scope
|
||||||
addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
|
const workerScope = <EventTarget>self;
|
||||||
|
workerScope.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue