quickjs_runtime::quickjs_utils::functions

Function new_native_function

source
pub unsafe fn new_native_function(
    context: *mut JSContext,
    name: &str,
    func: JSCFunction,
    arg_count: i32,
    is_constructor: bool,
) -> Result<QuickJsValueAdapter, JsError>
Expand description

create a new Function object which calls a native method

ยงSafety

When passing a context pointer please make sure the corresponding QuickJsContext is still valid