better path resolution

This commit is contained in:
2026-02-20 13:39:26 -06:00
parent 54e5be0773
commit f0c2486a5c
8 changed files with 188 additions and 78 deletions

View File

@@ -318,7 +318,9 @@ JSC_SCALL(os_system,
)
JSC_CCALL(os_exit,
exit(0);
int code = 0;
if (argc > 0) JS_ToInt32(js, &code, argv[0]);
exit(code);
)
static JSValue js_os_dylib_open(JSContext *js, JSValue self, int argc, JSValue *argv)
@@ -714,7 +716,7 @@ static const JSCFunctionListEntry js_os_funcs[] = {
MIST_FUNC_DEF(os, rusage, 0),
MIST_FUNC_DEF(os, mallinfo, 0),
MIST_FUNC_DEF(os, system, 1),
MIST_FUNC_DEF(os, exit, 0),
MIST_FUNC_DEF(os, exit, 1),
MIST_FUNC_DEF(os, sleep, 1),
MIST_FUNC_DEF(os, dylib_open, 1),
MIST_FUNC_DEF(os, dylib_preload, 1),