summaryrefslogtreecommitdiffstats
path: root/js/src/jsexn.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-12-13 20:55:05 -0500
committerGaming4JC <g4jc@hyperbola.info>2019-12-17 06:25:25 -0500
commitcba3f6142704ce228aaf54b5c98c6ef5b3f871be (patch)
tree1c8f2f34c67161b391456f6f3f3b523adc03283e /js/src/jsexn.cpp
parent4f88fc8513162fce0f1d39c099a994b91934ce7c (diff)
downloadUXP-cba3f6142704ce228aaf54b5c98c6ef5b3f871be.tar
UXP-cba3f6142704ce228aaf54b5c98c6ef5b3f871be.tar.gz
UXP-cba3f6142704ce228aaf54b5c98c6ef5b3f871be.tar.lz
UXP-cba3f6142704ce228aaf54b5c98c6ef5b3f871be.tar.xz
UXP-cba3f6142704ce228aaf54b5c98c6ef5b3f871be.zip
Bug 1343481 - Part 6: Add native functions wrapper for GetInternalError and GetTypeError.
Tag #1287
Diffstat (limited to 'js/src/jsexn.cpp')
-rw-r--r--js/src/jsexn.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/jsexn.cpp b/js/src/jsexn.cpp
index 3fc9200c1..72f03ea55 100644
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -32,6 +32,7 @@
#include "vm/ErrorObject.h"
#include "vm/GlobalObject.h"
#include "vm/SavedStacks.h"
+#include "vm/SelfHosting.h"
#include "vm/StringBuffer.h"
#include "jsobjinlines.h"
@@ -1091,3 +1092,19 @@ js::ValueToSourceForError(JSContext* cx, HandleValue val, JSAutoByteString& byte
return "<<error converting value to string>>";
return bytes.encodeLatin1(cx, str);
}
+
+bool
+js::GetInternalError(JSContext* cx, unsigned errorNumber, MutableHandleValue error)
+{
+ FixedInvokeArgs<1> args(cx);
+ args[0].set(Int32Value(errorNumber));
+ return CallSelfHostedFunction(cx, "GetInternalError", NullHandleValue, args, error);
+}
+
+bool
+js::GetTypeError(JSContext* cx, unsigned errorNumber, MutableHandleValue error)
+{
+ FixedInvokeArgs<1> args(cx);
+ args[0].set(Int32Value(errorNumber));
+ return CallSelfHostedFunction(cx, "GetTypeError", NullHandleValue, args, error);
+}