pub unsafe fn call_function(
cx: *mut JSContext,
func: Value,
this_obj: *mut JSObject,
args: &[Value],
) -> Result<JsValue, JsError>Expand description
Safely call a JS function value with the given arguments.
Returns Ok(JsValue) on success, Err(JsError) if the call throws.
§Safety
cx must be a valid JSContext. func must be a callable JS value.
All args items must be valid JSVal.