From 8afeb03278361501ec16ece6541cabbfc0cf1eac Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Wed, 11 Mar 2020 21:55:45 +0800 Subject: [PATCH] Fix worker startup blob script (#1013) --- src/agent.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/agent.rs b/src/agent.rs index 5ef6290722b..9535f51177d 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -1013,22 +1013,7 @@ fn worker_new(name_of_resource: &str, is_module: bool) -> Worker { let array = Array::new(); array.push( &format!( - r#"importScripts("{}"); - - let initialized = wasm_bindgen("{}").catch(err => {{ - // Propagate to main `onerror`: - setTimeout(() => {{ - throw err; - }}); - - // Rethrow to keep promise rejected and prevent execution of further commands: - throw err; - }}); - - self.onmessage = async (event) => {{ - await initialized; - wasm_bindgen.child_entry_point(event.data); - }};"#, + r#"importScripts("{}");wasm_bindgen("{}");"#, script_url, wasm_url ) .into(),