Files
scriptc/tests/library-mode/wasm/dispatch.mjs
Chris Tate c7b11a9242 Compile embeddable Wasm modules with host imports
- Emit callable Wasm reactors with explicit exports, host callbacks, and independent instance memory.
- Compile three.js scene and geometry workloads into Wasm without an embedded JavaScript engine.
- Document initialization, memory ownership, and external browser hosting.
2026-09-30 01:09:15 -05:00

14 lines
430 B
JavaScript

/** @returns {number} */
export function dispatch() {
return consume(1, 2, 3);
}
function consume(...values) {
const first = values.shift();
values.push(4);
const object = JSON.parse('{}');
Object.defineProperties(object, { score: { value: 5, enumerable: true } });
const add = (left, right) => left + right;
return Number(first) + values.join("").length + Number(object.score) + Number(add.apply(null, [6, 7]));
}