From 2debbdacb935cfe1eb7bb8d1f40a5063b339d90b Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 8 Apr 2019 17:10:00 -0400 Subject: Merge Worker and Isolate types (#2078) Reduces generics. --- js/compiler.ts | 1 - js/workers.ts | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/compiler.ts b/js/compiler.ts index 6172b614f..1a85de5f5 100644 --- a/js/compiler.ts +++ b/js/compiler.ts @@ -46,7 +46,6 @@ type SourceMap = string; interface CompilerLookup { specifier: ModuleSpecifier; referrer: ContainingFile; - isWorker: boolean; cmdId: number; } diff --git a/js/workers.ts b/js/workers.ts index 6b768bf08..456449d48 100644 --- a/js/workers.ts +++ b/js/workers.ts @@ -129,10 +129,13 @@ export async function workerMain(): Promise { log("workerMain got null message. quitting."); break; } + if (window["onmessage"]) { const event = { data }; window.onmessage(event); - } else { + } + + if (!window["onmessage"]) { break; } } -- cgit v1.2.3