]> git.kaiwu.me - quickjs.git/commitdiff
Fix arity of os.chdir and std.setenv (bnoordhuis)
authorFabrice Bellard <fabrice@bellard.org>
Mon, 26 Oct 2026 11:13:27 +0000 (12:13 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 26 Oct 2026 11:13:27 +0000 (12:13 +0100)
quickjs-libc.c

index bd4d35d7d0592dfe33c456519012069d3728a2b8..a180d832a958a41ec5929738e080c1038f495aa4 100644 (file)
@@ -1678,7 +1678,7 @@ static const JSCFunctionListEntry js_std_funcs[] = {
     JS_CFUNC_DEF("evalScript", 1, js_evalScript ),
     JS_CFUNC_DEF("loadScript", 1, js_loadScript ),
     JS_CFUNC_DEF("getenv", 1, js_std_getenv ),
-    JS_CFUNC_DEF("setenv", 1, js_std_setenv ),
+    JS_CFUNC_DEF("setenv", 2, js_std_setenv ),
     JS_CFUNC_DEF("unsetenv", 1, js_std_unsetenv ),
     JS_CFUNC_DEF("getenviron", 1, js_std_getenviron ),
     JS_CFUNC_DEF("urlGet", 1, js_std_urlGet ),
@@ -4023,7 +4023,7 @@ static const JSCFunctionListEntry js_os_funcs[] = {
     JS_CFUNC_DEF("sleepAsync", 1, js_os_sleepAsync ),
     JS_PROP_STRING_DEF("platform", OS_PLATFORM, 0 ),
     JS_CFUNC_DEF("getcwd", 0, js_os_getcwd ),
-    JS_CFUNC_DEF("chdir", 0, js_os_chdir ),
+    JS_CFUNC_DEF("chdir", 1, js_os_chdir ),
     JS_CFUNC_DEF("mkdir", 1, js_os_mkdir ),
     JS_CFUNC_DEF("readdir", 1, js_os_readdir ),
     /* st_mode constants */