diff options
author | Moonchild <moonchild@palemoon.org> | 2020-08-06 18:31:36 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-08-30 09:37:12 +0000 |
commit | 10a10fd3757374123eb5e3aab1e4720f86575f47 (patch) | |
tree | 2e7d794acdd6105eba65013cff421fe7dad94299 /js/src/jsapi.cpp | |
parent | 1012dbe9e5b2d00f967b0523f94ac8cc7ed3118d (diff) | |
download | UXP-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.cpp')
-rw-r--r-- | js/src/jsapi.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 77124355c..69a3ba2ac 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4667,21 +4667,16 @@ JS::Evaluate(JSContext* cx, const ReadOnlyCompileOptions& optionsArg, return ::Evaluate(cx, optionsArg, filename, rval); } -JS_PUBLIC_API(JSFunction*) -JS::GetModuleResolveHook(JSContext* cx) +JS_PUBLIC_API(JS::ModuleResolveHook) +JS::GetModuleResolveHook(JSRuntime* rt) { - AssertHeapIsIdle(cx); - CHECK_REQUEST(cx); - return cx->global()->moduleResolveHook(); + return rt->moduleResolveHook; } JS_PUBLIC_API(void) -JS::SetModuleResolveHook(JSContext* cx, HandleFunction func) +JS::SetModuleResolveHook(JSRuntime* rt, JS::ModuleResolveHook func) { - AssertHeapIsIdle(cx); - CHECK_REQUEST(cx); - assertSameCompartment(cx, func); - cx->global()->setModuleResolveHook(func); + rt->moduleResolveHook = func; } JS_PUBLIC_API(bool) |