summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index cf5880e03..69a3ba2ac 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -483,6 +483,11 @@ JS_DestroyContext(JSContext* cx)
DestroyContext(cx);
}
+JS_PUBLIC_API(JSRuntime*)
+JS_GetRuntime(JSContext* cx) {
+ return cx->runtime();
+}
+
static JS_CurrentEmbedderTimeFunction currentEmbedderTimeFunction;
JS_PUBLIC_API(void)
@@ -4662,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)
@@ -4739,18 +4739,6 @@ JS::GetModuleScript(JSContext* cx, JS::HandleObject moduleArg)
return moduleArg->as<ModuleObject>().script();
}
-JS_PUBLIC_API(bool)
-JS::IsModuleErrored(JSObject* moduleArg)
-{
- return moduleArg->as<ModuleObject>().status() == MODULE_STATUS_ERRORED;
-}
-
-JS_PUBLIC_API(JS::Value)
-JS::GetModuleError(JSObject* moduleArg)
-{
- return moduleArg->as<ModuleObject>().error();
-}
-
JS_PUBLIC_API(JSObject*)
JS_New(JSContext* cx, HandleObject ctor, const JS::HandleValueArray& inputArgs)
{