mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
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.
This commit is contained in:
parent
976239c8d0
commit
34db761758
10 changed files with 76 additions and 74 deletions
|
|
@ -4325,17 +4325,19 @@ extern JS_PUBLIC_API(bool)
|
|||
Evaluate(JSContext* cx, const ReadOnlyCompileOptions& options,
|
||||
const char* filename, JS::MutableHandleValue rval);
|
||||
|
||||
/**
|
||||
* Get the HostResolveImportedModule hook for a global.
|
||||
*/
|
||||
extern JS_PUBLIC_API(JSFunction*)
|
||||
GetModuleResolveHook(JSContext* cx);
|
||||
using ModuleResolveHook = JSObject* (*)(JSContext*, HandleObject, HandleString);
|
||||
|
||||
/**
|
||||
* Set the HostResolveImportedModule hook for a global to the given function.
|
||||
* Get the HostResolveImportedModule hook for the runtime.
|
||||
*/
|
||||
extern JS_PUBLIC_API(ModuleResolveHook)
|
||||
GetModuleResolveHook(JSRuntime* rt);
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue