Skip to content

Commit

Permalink
js/backend: fix kiesel
Browse files Browse the repository at this point in the history
  • Loading branch information
CanadaHonk committed Nov 8, 2023
1 parent 918f373 commit 369f990
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine/js/backends/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const decoder = new TextDecoder('utf8');
const SERIAL_RES_SIZE = 1024 * 1024 * 10;
const decodeBuffer = new Uint8Array(SERIAL_RES_SIZE);

let lengthBuffer, lengthTyped, valueBuffer, valueTyped;
let lengthBuffer, lengthTyped, valueBuffer, valueTyped, js;
self.addEventListener('message', e => {
// console.log('special worker onmessage', e.data);
if (!lengthBuffer && e.data.lengthBuffer) {
Expand All @@ -12,6 +12,8 @@ self.addEventListener('message', e => {

valueBuffer = e.data.valueBuffer;
valueTyped = new Uint8Array(valueBuffer);

js = e.data.js;
}
});

Expand All @@ -32,9 +34,11 @@ const loadWasm = async url => {
};

export default async (url, args) => {
const js = await (await fetch('/engine/js/ipc/inside.js')).text();
const wasmModule = await loadWasm(url);

// hack: kiesel does not have await yet and isn't even called so just remove it
if (args[0] === 'kiesel') js = js.replace('await ', '');

const wasmFs = new WasmFs();

let wasi = new WASI({
Expand Down

0 comments on commit 369f990

Please sign in to comment.