From e99374a0a304bc3bd11ee55274fb7f4bcf902da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 3 Apr 2020 18:01:45 +0200 Subject: [PATCH] make Worker.poll private (#4603) --- cli/js/web/workers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/js/web/workers.ts b/cli/js/web/workers.ts index 834d0f2978..a62ca0b778 100644 --- a/cli/js/web/workers.ts +++ b/cli/js/web/workers.ts @@ -92,7 +92,7 @@ export class WorkerImpl extends EventTarget implements Worker { options?.name ); this.#id = id; - this.poll(); + this.#poll(); } #handleError = (e: any): boolean => { @@ -116,7 +116,7 @@ export class WorkerImpl extends EventTarget implements Worker { return handled; }; - async poll(): Promise { + #poll = async (): Promise => { while (!this.#terminated) { const event = await hostGetMessage(this.#id); @@ -150,7 +150,7 @@ export class WorkerImpl extends EventTarget implements Worker { throw new Error(`Unknown worker event: "${type}"`); } - } + }; postMessage(data: any): void { if (this.#terminated) {