From 67e4da4695f54dfb29d1c7ed57bf07f75116bdeb Mon Sep 17 00:00:00 2001
From: The Ghost of FOSS' Future
<163201376+sneedgroup-holder@users.noreply.github.com>
Date: Thu, 9 Jan 2025 01:03:54 +0000
Subject: [PATCH] Update qjs.c
---
qjs.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/qjs.c b/qjs.c
index 147c8c6..dddffa1 100644
--- a/qjs.c
+++ b/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), "", JS_EVAL_TYPE_MODULE);
+ }
+
+ eval_buf(ctx, pf, strlen(pf), "", JS_EVAL_TYPE_MODULE);
ret = eval_buf(ctx, buf, buf_len, filename, eval_flags);
js_free(ctx, buf);
return ret;