summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.h')
-rw-r--r--js/src/jsapi.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 9c3bf8151..5cdfd958e 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -995,6 +995,9 @@ JS_NewContext(uint32_t maxbytes,
extern JS_PUBLIC_API(void)
JS_DestroyContext(JSContext* cx);
+extern JS_PUBLIC_API(JSRuntime*)
+JS_GetRuntime(JSContext* cx);
+
typedef double (*JS_CurrentEmbedderTimeFunction)();
/**
@@ -4322,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
@@ -4395,12 +4400,6 @@ GetRequestedModules(JSContext* cx, JS::HandleObject moduleRecord);
extern JS_PUBLIC_API(JSScript*)
GetModuleScript(JSContext* cx, JS::HandleObject moduleRecord);
-extern JS_PUBLIC_API(bool)
-IsModuleErrored(JSObject* moduleRecord);
-
-extern JS_PUBLIC_API(JS::Value)
-GetModuleError(JSObject* moduleRecord);
-
} /* namespace JS */
extern JS_PUBLIC_API(bool)