support JSON modules in qjsc - added support of JSON5 modules (using type = "json5")

This commit is contained in:
Fabrice Bellard
2025-05-24 10:24:01 +02:00
parent 1dfaa61680
commit 7c487f1c6a
7 changed files with 149 additions and 44 deletions

View File

@@ -872,7 +872,7 @@ static JSModuleDef *js_module_loader_test(JSContext *ctx,
return NULL;
}
if (js_module_test_json(ctx, attributes)) {
if (js_module_test_json(ctx, attributes) == 1) {
/* compile as JSON */
JSValue val;
val = JS_ParseJSON(ctx, (char *)buf, buf_len, module_name);