aboutsummaryrefslogtreecommitdiff
path: root/lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs
diff options
context:
space:
mode:
Diffstat (limited to 'lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs')
-rw-r--r--lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs45
1 files changed, 45 insertions, 0 deletions
diff --git a/lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs b/lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs
index 546d51021497..75e224aabb8d 100644
--- a/lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs
+++ b/lang/p5-JavaScript-QuickJS/files/patch-QuickJS.xs
@@ -1,5 +1,6 @@
Obtained from: https://github.com/FGasper/p5-JavaScript-QuickJS/issues/13
https://github.com/FGasper/p5-JavaScript-QuickJS/tree/quickjs_2025_04
+Reference: https://github.com/bellard/quickjs/commit/f10ef299a6ab4c36c4162cc5840f128f74ec197c
--- QuickJS.xs.orig 2024-02-12 14:21:20 UTC
+++ QuickJS.xs
@@ -14,3 +15,47 @@ Obtained from: https://github.com/FGasper/p5-JavaScript-QuickJS/issues/13
[JS_TAG_SYMBOL - JS_TAG_FIRST] = "symbol",
[JS_TAG_MODULE - JS_TAG_FIRST] = "module",
[JS_TAG_OBJECT - JS_TAG_FIRST] = "object",
+@@ -649,7 +648,7 @@ static JSModuleDef *pqjs_module_loader(JSContext *ctx,
+ }
+
+ static JSModuleDef *pqjs_module_loader(JSContext *ctx,
+- const char *module_name, void *opaque) {
++ const char *module_name, void *opaque, JSValueConst attributes) {
+ char** module_base_path_p = (char**) opaque;
+
+ char* module_base_path = *module_base_path_p;
+@@ -666,10 +665,10 @@ static JSModuleDef *pqjs_module_loader(JSContext *ctx,
+ memcpy(real_path + base_path_len, module_name, module_name_len);
+ real_path[base_path_len + module_name_len] = 0;
+
+- moduledef = js_module_loader(ctx, real_path, NULL);
++ moduledef = js_module_loader(ctx, real_path, NULL, attributes);
+ }
+ else {
+- moduledef = js_module_loader(ctx, module_name, NULL);
++ moduledef = js_module_loader(ctx, module_name, NULL, attributes);
+ }
+
+ return moduledef;
+@@ -751,7 +750,7 @@ _new (SV* classname_sv)
+ CODE:
+ JSRuntime *rt = JS_NewRuntime();
+ JS_SetHostPromiseRejectionTracker(rt, js_std_promise_rejection_tracker, NULL);
+- JS_SetModuleLoaderFunc(rt, NULL, js_module_loader, NULL);
++ JS_SetModuleLoaderFunc2(rt, NULL, js_module_loader, js_module_check_attributes, NULL);
+
+ JSContext *ctx = _create_new_jsctx(aTHX_ rt);
+
+@@ -763,10 +762,11 @@ _new (SV* classname_sv)
+ .pid = getpid(),
+ };
+
+- JS_SetModuleLoaderFunc(
++ JS_SetModuleLoaderFunc2(
+ rt,
+ NULL,
+ pqjs_module_loader,
++ js_module_check_attributes,
+ &pqjs->module_base_path
+ );
+