Update qjs.c

This commit is contained in:
The Ghost of FOSS' Future 2025-01-09 01:03:54 +00:00 committed by GitHub
parent 2eda1aa250
commit 67e4da4695
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

9
qjs.c
View file

@ -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;