fixes + cleartimeout

This commit is contained in:
The Ghost of FOSS' Past 2024-10-24 15:50:48 -05:00
parent 8f39c02ea6
commit d838e9cc47

15
qjs.c
View file

@ -508,15 +508,16 @@ int main(int argc, char **argv)
eval_buf(ctx, reqPF, strlen(reqPF), "<input>", JS_EVAL_TYPE_MODULE);
const char *timeoutPF = "globalThis.setTimeout = os.setTimeout\n"
"globalThis.sleep = os.sleep";
const char *timeoutPF = "globalThis.setTimeout = globalThis.os.setTimeout\n"
"globalThis.clearTimeout = globalThis.os.clearTimeout\n"
"globalThis.sleep = globalThis.os.sleep";
eval_buf(ctx, timeoutPF, strlen(timeoutPF), "<input>", JS_EVAL_TYPE_MODULE);
const char *stdGlobals = "globalThis.urlGet = std.urlGet\n"
"globalThis.loadFile = std.loadFile\n"
"globalThis.printf = std.printf\n"
"globalThis.evalFile = std.loadScript\n"
"globalThis.getURL = std.urlGet";
const char *stdGlobals = "globalThis.urlGet = globalThis.std.urlGet\n"
"globalThis.loadFile = globalThis.std.loadFile\n"
"globalThis.printf = globalThis.std.printf\n"
"globalThis.evalFile = globalThis.std.loadScript\n"
"globalThis.getURL = globalThis.std.urlGet";
eval_buf(ctx, stdGlobals, strlen(stdGlobals), "<input>", JS_EVAL_TYPE_MODULE);