From f2809d1ed8b7f93d3497d27b9d2a6f261fdbdec7 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 31 May 2016 17:15:54 -0700 Subject: [PATCH] fix(PostMessageBus):Add the worker scope to please Closure --- .../src/web_workers/shared/post_message_bus.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts b/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts index d56e45790f..db42fe6899 100644 --- a/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts +++ b/modules/@angular/platform-browser/src/web_workers/shared/post_message_bus.ts @@ -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 = self; + workerScope.addEventListener("message", (ev: MessageEvent) => this._handleMessages(ev)); } }