fixes + cleartimeout
This commit is contained in:
parent
8f39c02ea6
commit
d838e9cc47
1 changed files with 8 additions and 7 deletions
15
qjs.c
15
qjs.c
|
@ -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);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue