fix(PostMessageBus):Add the worker scope to please Closure

This commit is contained in:
Victor Berchet 2016-05-31 17:15:54 -07:00
parent f4f6b8721a
commit f2809d1ed8
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ export class PostMessageBusSource implements MessageBusSource {
eventTarget.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev));
} else {
// 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));
}
}