MCPcopy Create free account
hub / github.com/GNOME/gjs / call_function

Method call_function

gjs/context.cpp:1720–1730  ·  view source on GitHub ↗

* GjsContextPrivate::call_function: * @this_obj: Object to use as the 'this' for the function call * @func_val: Callable to call, as a JS value * @args: Arguments to pass to the callable * @rval: Location for the return value * * Use this instead of JS_CallFunctionValue(), because it schedules a GC if one * is needed. It's good practice to check if a GC should be run every time we * return

Source from the content-addressed store, hash-verified

1718 * return from JS back into C++.
1719 */
1720bool GjsContextPrivate::call_function(JS::HandleObject this_obj,
1721 JS::HandleValue func_val,
1722 const JS::HandleValueArray& args,
1723 JS::MutableHandleValue rval) {
1724 if (!JS_CallFunctionValue(m_cx, this_obj, func_val, args, rval))
1725 return false;
1726
1727 schedule_gc_if_needed();
1728
1729 return true;
1730}
1731
1732bool gjs_context_define_string_array(GjsContext* self, const char* array_name,
1733 ssize_t array_length,

Callers 2

constructor_implMethod · 0.80
invoke_static_methodMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected