diff options
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r-- | js/src/jsapi.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index d75a3c33a..cf5880e03 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4704,21 +4704,21 @@ JS::GetModuleHostDefinedField(JSObject* module) } JS_PUBLIC_API(bool) -JS::ModuleDeclarationInstantiation(JSContext* cx, JS::HandleObject moduleArg) +JS::ModuleInstantiate(JSContext* cx, JS::HandleObject moduleArg) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); assertSameCompartment(cx, moduleArg); - return ModuleObject::DeclarationInstantiation(cx, moduleArg.as<ModuleObject>()); + return ModuleObject::Instantiate(cx, moduleArg.as<ModuleObject>()); } JS_PUBLIC_API(bool) -JS::ModuleEvaluation(JSContext* cx, JS::HandleObject moduleArg) +JS::ModuleEvaluate(JSContext* cx, JS::HandleObject moduleArg) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); assertSameCompartment(cx, moduleArg); - return ModuleObject::Evaluation(cx, moduleArg.as<ModuleObject>()); + return ModuleObject::Evaluate(cx, moduleArg.as<ModuleObject>()); } JS_PUBLIC_API(JSObject*) @@ -4739,6 +4739,18 @@ 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) { |