Skip to main content

new_runtime_function

Function new_runtime_function 

Source
pub unsafe fn new_runtime_function(
    cx: &mut JSContext,
    parent: Handle<'_, *mut JSObject>,
    name: &str,
    nargs: u32,
    host_fn: unsafe extern "C" fn(*mut JSContext, u32, *mut Value) -> bool,
    flags: u32,
) -> *mut JSObject
Expand description

Create a new JSFunction from a host function pointer.

§Safety

cx must be a valid JSContext. parent must be a valid JSObject. host_fn must be a valid JSHostFn that remains valid for the function’s lifetime.