This commit is contained in:
2026-02-22 20:48:17 -06:00
parent 012b507415
commit 62440d3ed6
8 changed files with 116 additions and 8 deletions

View File

@@ -789,9 +789,32 @@ double cell_random() {
return (double)buf / 9007199254740992.0;
}
static cell_hook g_cell_trace_hook = NULL;
void cell_trace_sethook(cell_hook hook)
{
(void)hook;
g_cell_trace_hook = hook;
}
cell_hook cell_trace_gethook(void)
{
return g_cell_trace_hook;
}
void cell_rt_set_trace_hook(JSContext *ctx, cell_hook hook)
{
struct cell_rt *rt = JS_GetContextOpaque(ctx);
if (rt) rt->trace_hook = hook;
}
const char *cell_rt_name(struct cell_rt *rt)
{
return rt->name;
}
JSContext *cell_rt_context(struct cell_rt *rt)
{
return rt->context;
}
int uncaught_exception(JSContext *js, JSValue v)