added the static_mods table for adding externally added static modules
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-16 17:58:01 +09:00
parent d3b90da1e7
commit ca1cf488e4
14 changed files with 465 additions and 264 deletions

View File

@@ -2987,15 +2987,21 @@ hawk_fnc_t* hawk_rtx_valtofnc (hawk_rtx_t* rtx, hawk_val_t* v, hawk_fnc_t* rfnc)
hawk_mod_sym_t sym;
mod = hawk_querymodulewithname(hawk, x.ptr, &sym);
hawk_rtx_freevaloocstr(rtx, v, x.ptr);
if (!mod) return HAWK_NULL;
if (!mod)
{
hawk_rtx_freevaloocstr(rtx, v, x.ptr);
return HAWK_NULL;
}
if (sym.type != HAWK_MOD_FNC || (hawk->opt.trait & sym.u.fnc_.trait) != sym.u.fnc_.trait)
{
hawk_rtx_seterrnum(rtx, HAWK_NULL, HAWK_ENOENT);
hawk_rtx_seterrfmt(rtx, HAWK_NULL, HAWK_ENOENT, HAWK_T("'%.*js' not a function or unsupported"), x.len, x.ptr);
hawk_rtx_freevaloocstr(rtx, v, x.ptr);
return HAWK_NULL;
}
hawk_rtx_freevaloocstr(rtx, v, x.ptr);
HAWK_MEMSET(rfnc, 0, HAWK_SIZEOF(*rfnc));
rfnc->name.ptr = sym.name;
rfnc->name.len = hawk_count_oocstr(sym.name);