Issue #1691 - Part 3: Finish implementing import meta. https://bugzilla.mozilla.org/show_bug.cgi?id=1427610

(cherry picked from commit a8625238ac846fb7eb103646ddb8634a5860f067)
This commit is contained in:
Brian Smith 2023-04-08 15:01:22 -05:00 committed by roytam1
commit 3f4985ce6c
18 changed files with 207 additions and 9 deletions

View file

@ -4338,6 +4338,21 @@ GetModuleResolveHook(JSRuntime* rt);
extern JS_PUBLIC_API(void)
SetModuleResolveHook(JSRuntime* rt, ModuleResolveHook func);
using ModuleMetadataHook = bool (*)(JSContext*, HandleObject, HandleObject);
/**
* Get the hook for populating the import.meta metadata object.
*/
extern JS_PUBLIC_API(ModuleMetadataHook)
GetModuleMetadataHook(JSContext* cx);
/**
* Set the hook for populating the import.meta metadata object to the given
* function.
*/
extern JS_PUBLIC_API(void)
SetModuleMetadataHook(JSContext* cx, ModuleMetadataHook func);
/**
* Parse the given source buffer as a module in the scope of the current global
* of cx and return a source text module record.