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
9
qjs.c
9
qjs.c
|
@ -176,12 +176,13 @@ static int eval_file(JSContext *ctx, const char *filename, int module)
|
||||||
module = (js__has_suffix(filename, ".mjs") ||
|
module = (js__has_suffix(filename, ".mjs") ||
|
||||||
JS_DetectModule((const char *)buf, buf_len));
|
JS_DetectModule((const char *)buf, buf_len));
|
||||||
}
|
}
|
||||||
if (module)
|
if (module) {
|
||||||
eval_flags = JS_EVAL_TYPE_MODULE;
|
eval_flags = JS_EVAL_TYPE_MODULE;
|
||||||
else
|
} else {
|
||||||
eval_flags = JS_EVAL_TYPE_GLOBAL;
|
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);
|
ret = eval_buf(ctx, buf, buf_len, filename, eval_flags);
|
||||||
js_free(ctx, buf);
|
js_free(ctx, buf);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue