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

Method warn_about_illegal_js_callback

gi/function.cpp:279–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void GjsCallbackTrampoline::warn_about_illegal_js_callback(const char* when,
280 const char* reason,
281 bool dump_stack) {
282 std::ostringstream message;
283
284 message << "Attempting to run a JS callback " << when << ". "
285 << "This is most likely caused by " << reason << ". "
286 << "Because it would crash the application, it has been blocked.\n"
287 << "The offending callback was " << m_info.name() << "()"
288 << (m_is_vfunc ? ", a vfunc." : ".");
289
290 if (dump_stack) {
291 message << "\n" << gjs_dumpstack_string();
292 }
293 g_critical("%s", message.str().c_str());
294}
295
296/* This is our main entry point for ffi_closure callbacks. ffi_prep_closure() is
297 * doing pure magic and replaces the original function call with this one which

Callers

nothing calls this directly

Calls 2

gjs_dumpstack_stringFunction · 0.85
nameMethod · 0.45

Tested by

no test coverage detected