Skip to content

Commit

Permalink
the small unquoting
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed Oct 7, 2023
1 parent 831e063 commit 0379c63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/browser/starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function V86(options)
//var adapter_bus = this.bus = WorkerBus.init(worker);

this.cpu_is_running = false;
this.cpu_exception_hook = function(n) {};

const bus = Bus.create();
const adapter_bus = this.bus = bus[0];
Expand All @@ -102,12 +103,10 @@ function V86(options)
var cpu;
var wasm_memory;

const wasm_table = new WebAssembly.Table({ element: "anyfunc", "initial": WASM_TABLE_SIZE + WASM_TABLE_OFFSET });
const wasm_table = new WebAssembly.Table({ element: "anyfunc", initial: WASM_TABLE_SIZE + WASM_TABLE_OFFSET });

const wasm_shared_funcs = {
"cpu_exception_hook": (n) => {
return this["cpu_exception_hook"] && this["cpu_exception_hook"](n);
},
"cpu_exception_hook": n => this.cpu_exception_hook(n),
"hlt_op": function() { return cpu.hlt_op(); },
"abort": function() { dbg_assert(false); },
"microtick": v86.microtick,
Expand Down Expand Up @@ -660,7 +659,7 @@ V86.prototype.zstd_decompress_worker = async function(decompressed_size, src)
"jit_clear_func", "jit_clear_all_funcs",
].map(f => [f, () => console.error("zstd worker unexpectedly called " + f)]));

env["__indirect_function_table"] = new WebAssembly.Table({ element: "anyfunc", "initial": 1024 });
env["__indirect_function_table"] = new WebAssembly.Table({ element: "anyfunc", initial: 1024 });
env["abort"] = () => { throw new Error("zstd worker aborted"); };
env["log_from_wasm"] = env["console_log_from_wasm"] = (off, len) => {
console.log(String.fromCharCode(...new Uint8Array(wasm.exports.memory.buffer, off, len)));
Expand Down

0 comments on commit 0379c63

Please sign in to comment.