Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/wasm32/js/web_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ importScripts('WASM_BINDGEN_SHIM_URL');
// Once we've got it, initialize it all with the `wasm_bindgen` global we imported via
// `importScripts`.
self.onmessage = event => {
let [ module, memory, work ] = event.data;
const [module_or_path, memory, work] = event.data;

wasm_bindgen(module, memory).catch(err => {
wasm_bindgen({ module_or_path, memory }).catch(err => {
console.log(err);

// Propagate to main `onerror`:
Expand All @@ -25,4 +25,3 @@ self.onmessage = event => {
close();
});
};

6 changes: 3 additions & 3 deletions src/wasm32/js/web_worker_module.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// synchronously, using the browser, import wasm_bindgen shim JS scripts
import init, {wasm_thread_entry_point} from "WASM_BINDGEN_SHIM_URL";
import init, { wasm_thread_entry_point } from "WASM_BINDGEN_SHIM_URL";

// Wait for the main thread to send us the shared module/memory and work context.
// Once we've got it, initialize it all with the `wasm_bindgen` global we imported via
// `importScripts`.
self.onmessage = event => {
let [ module, memory, work ] = event.data;
const [module_or_path, memory, work] = event.data;

init(module, memory).catch(err => {
init({ module_or_path, memory }).catch(err => {
console.log(err);

// Propagate to main `onerror`:
Expand Down