summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-03 14:15:55 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-03 14:15:55 +0000
commit74c48bcc74fe566d8555eed6792d0bdb2003fff3 (patch)
tree79df6e5f4d8f963d71cc25cd81020e7c6f400197 /js/src/jsapi.cpp
parent9ca74147225eed305e28c7887f9b2251aeeb0f36 (diff)
downloadUXP-74c48bcc74fe566d8555eed6792d0bdb2003fff3.tar
UXP-74c48bcc74fe566d8555eed6792d0bdb2003fff3.tar.gz
UXP-74c48bcc74fe566d8555eed6792d0bdb2003fff3.tar.lz
UXP-74c48bcc74fe566d8555eed6792d0bdb2003fff3.tar.xz
UXP-74c48bcc74fe566d8555eed6792d0bdb2003fff3.zip
Issue #618 - Add APIs to query module record errors
Ref: BZ 1388728
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 53ea4ebc6..f8c34885b 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -4739,6 +4739,20 @@ JS::GetModuleScript(JSContext* cx, JS::HandleObject moduleArg)
return moduleArg->as<ModuleObject>().script();
}
+JS_PUBLIC_API(bool)
+JS::IsModuleErrored(JSObject* moduleArg)
+{
+ AssertHeapIsIdle();
+ return moduleArg->as<ModuleObject>().status() == MODULE_STATUS_ERRORED;
+}
+
+JS_PUBLIC_API(JS::Value)
+JS::GetModuleError(JSObject* moduleArg)
+{
+ AssertHeapIsIdle();
+ return moduleArg->as<ModuleObject>().error();
+}
+
JS_PUBLIC_API(JSObject*)
JS_New(JSContext* cx, HandleObject ctor, const JS::HandleValueArray& inputArgs)
{