diff options
author | Moonchild <moonchild@palemoon.org> | 2020-07-03 14:15:55 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-07-10 18:29:52 +0000 |
commit | 7bf3e4c46475a7aa936d702eb38d65d9126008f2 (patch) | |
tree | b43009d64e8470586980538d43b062122a13bf68 /js/src/jsapi.cpp | |
parent | 57523a0debf898dc9583bfbc6c12f3e024f40b23 (diff) | |
download | UXP-7bf3e4c46475a7aa936d702eb38d65d9126008f2.tar UXP-7bf3e4c46475a7aa936d702eb38d65d9126008f2.tar.gz UXP-7bf3e4c46475a7aa936d702eb38d65d9126008f2.tar.lz UXP-7bf3e4c46475a7aa936d702eb38d65d9126008f2.tar.xz UXP-7bf3e4c46475a7aa936d702eb38d65d9126008f2.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.cpp | 14 |
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) { |