pub fn function<F>(
context: &Context,
name: &str,
arity: u32,
handler: F,
) -> Result<Value>Expand description
Creates a direct native JS function with argument decoding and a panic boundary.
An error throws a JavaScript exception; snapshots can return ordinary values
synchronously. Use Context::promise only for genuinely asynchronous work.