1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-09 07:39:15 -05:00

make Worker.poll private (#4603)

This commit is contained in:
Bartek Iwańczuk 2020-04-03 18:01:45 +02:00 committed by GitHub
parent ce02167c75
commit e99374a0a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<void> {
#poll = async (): Promise<void> => {
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) {