* 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
| 1718 | * return from JS back into C++. |
| 1719 | */ |
| 1720 | bool 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 | |
| 1732 | bool gjs_context_define_string_array(GjsContext* self, const char* array_name, |
| 1733 | ssize_t array_length, |
no outgoing calls
no test coverage detected