wasm-rquickjs-cli 0.5.3

Tool for wrapping JavaScript modules as WebAssembly components using the QuickJS engine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function fail(kind) {
    if (kind === 'success') return 'ok';
    if (kind === 'backend-error') throw { tag: kind, val: 'service unavailable' };
    if (kind === 'nested') throw { tag: kind, val: { tag: 'permission-denied' } };
    throw { tag: 'permission-denied' };
}

export const api = {
    fail,
    failEnum() { throw 'permission-denied'; },
    failString() { throw 'host unavailable'; },
    failRecord() { throw { tag: '', toString: 'declared field', count: 9007199254740993n }; },
    Gate: class {
        static failStatic(kind) { return fail(kind); }
    },
};