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-30 09:37:12 +0000
commit10a10fd3757374123eb5e3aab1e4720f86575f47 (patch)
tree2e7d794acdd6105eba65013cff421fe7dad94299 /js/src/jsapi.h
parent1012dbe9e5b2d00f967b0523f94ac8cc7ed3118d (diff)
downloadUXP-10a10fd3757374123eb5e3aab1e4720f86575f47.tar
UXP-10a10fd3757374123eb5e3aab1e4720f86575f47.tar.gz
UXP-10a10fd3757374123eb5e3aab1e4720f86575f47.tar.lz
UXP-10a10fd3757374123eb5e3aab1e4720f86575f47.tar.xz
UXP-10a10fd3757374123eb5e3aab1e4720f86575f47.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