Skip to main content

Module value

Module value 

Source
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:

tagvalue
0undefined
1null
2 / 3false / true
4number: f64
5string: u32 byte length, utf-8 bytes
6bytes (ArrayBuffer, Uint8Array): u32 length, bytes
7array: u32 count, values
8object: u32 count, (string key, value) pairs
9function: u32 callback id, string name
10arena: u32 handle
11node (AstArenaNode): u32 arena handle, u32 id
12promise: u32 id
13error: string message
14output 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