Expand description
Values exchanged with javascript and their binary encoding (shared by the N-API and the WASM bindings).
Little endian. Each value starts with a tag:
| tag | value |
|---|---|
| 0 | undefined |
| 1 | null |
| 2 / 3 | false / true |
| 4 | number: f64 |
| 5 | string: u32 byte length, utf-8 bytes |
| 6 | bytes (ArrayBuffer, Uint8Array): u32 length, bytes |
| 7 | array: u32 count, values |
| 8 | object: u32 count, (string key, value) pairs |
| 9 | function: u32 callback id, string name |
| 10 | arena: u32 handle |
| 11 | node (AstArenaNode): u32 arena handle, u32 id |
| 12 | promise: u32 id |
| 13 | error: string message |
| 14 | output buffer: u32 id, u32 length (a rust buffer given to javascript, see take_output()) |
Enums§
- Val
- a javascript value
Functions§
- undefined
- a reference to
undefined