(getExports)
| 13 | const TAG_BYTES = 4; |
| 14 | |
| 15 | export function makeRt(getExports) { |
| 16 | return { |
| 17 | decodeStr: (h) => decodeStr(getExports(), h), |
| 18 | decodeInt: (h) => decodeInt(getExports(), h), |
| 19 | decodeBool: (h) => decodeBool(getExports(), h), |
| 20 | decodeFloat: (h) => decodeFloat(getExports(), h), |
| 21 | encodeStr: (s) => encodeStr(getExports(), s), |
| 22 | encodeInt: (n) => encodeInt(getExports(), n), |
| 23 | encodeBool: (b) => encodeBool(getExports(), b), |
| 24 | encodeFloat: (f) => encodeFloat(getExports(), f), |
| 25 | encodeNone: () => getExports().host_edge_encode(TAG_NONE, 0, 0), |
| 26 | /* Tag-agnostic: decode any handle to a plain JS value; used by deferred host-call shuttling. */ |
| 27 | decodeAny: (h) => decodeAny(getExports(), h), |
| 28 | /* Tag-agnostic: encode a plain JS value back into a handle. Integer numbers become INT; non-integer become FLOAT. */ |
| 29 | encodeAny: (v) => encodeAny(getExports(), v), |
| 30 | }; |
| 31 | } |
| 32 | |
| 33 | function decodeBytes(exps, handle, expectedTag) { |
| 34 | const tagPtr = exps.wasm_alloc(4); |
no test coverage detected