summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-08-06 18:31:36 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-06 18:31:36 +0000
commit9b6252893876995ae4c1f278fc8d1cbdfb72e94d (patch)
treecf42ccabb78f3abb13e8df6a0512e3a43258f7c2 /js/src/jsapi.h
parentc349f04f9501c5035667f8064782d06e298cb52a (diff)
downloadUXP-9b6252893876995ae4c1f278fc8d1cbdfb72e94d.tar
UXP-9b6252893876995ae4c1f278fc8d1cbdfb72e94d.tar.gz
UXP-9b6252893876995ae4c1f278fc8d1cbdfb72e94d.tar.lz
UXP-9b6252893876995ae4c1f278fc8d1cbdfb72e94d.tar.xz
UXP-9b6252893876995ae4c1f278fc8d1cbdfb72e94d.zip
Issue #618 - Simplify module resolve hook to be a function pointer
This is an ahead-of time port to try and address #1624. This is based on BZ 1461751 and Jon Coppeard's work in it.
Diffstat (limited to 'js/src/jsapi.h')
-rw-r--r--js/src/jsapi.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index c6299e3f5..5cdfd958e 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -4325,17 +4325,19 @@ extern JS_PUBLIC_API(bool)
Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
const char* filename, JS::MutableHandleValue rval);
+using ModuleResolveHook = JSObject* (*)(JSContext*, HandleObject, HandleString);
+
/**
- * Get the HostResolveImportedModule hook for a global.
+ * Get the HostResolveImportedModule hook for the runtime.
*/
-extern JS_PUBLIC_API(JSFunction*)
-GetModuleResolveHook(JSContext* cx);
+extern JS_PUBLIC_API(ModuleResolveHook)
+GetModuleResolveHook(JSRuntime* rt);
/**
- * Set the HostResolveImportedModule hook for a global to the given function.
+ * Set the HostResolveImportedModule hook for the runtime to the given function.
*/
extern JS_PUBLIC_API(void)
-SetModuleResolveHook(JSContext* cx, JS::HandleFunction func);
+SetModuleResolveHook(JSRuntime* rt, ModuleResolveHook func);
/**
* Parse the given source buffer as a module in the scope of the current global