mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Update qjs.c
This commit is contained in:
parent
2eda1aa250
commit
67e4da4695
1 changed files with 5 additions and 4 deletions
7
qjs.c
7
qjs.c
|
@ -176,12 +176,13 @@ static int eval_file(JSContext *ctx, const char *filename, int module)
|
|||
module = (js__has_suffix(filename, ".mjs") ||
|
||||
JS_DetectModule((const char *)buf, buf_len));
|
||||
}
|
||||
if (module)
|
||||
if (module) {
|
||||
eval_flags = JS_EVAL_TYPE_MODULE;
|
||||
else
|
||||
} else {
|
||||
eval_flags = JS_EVAL_TYPE_GLOBAL;
|
||||
}
|
||||
|
||||
//eval_buf(ctx, pf, strlen(pf), "<input>", JS_EVAL_TYPE_MODULE);
|
||||
eval_buf(ctx, pf, strlen(pf), "<input>", JS_EVAL_TYPE_MODULE);
|
||||
ret = eval_buf(ctx, buf, buf_len, filename, eval_flags);
|
||||
js_free(ctx, buf);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue