summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/jsthread.cpp
diff options
context:
space:
mode:
authorJustin Seyster <justin.seyster@mongodb.com>2022-02-28 22:30:51 -0500
committerJustin Seyster <justin.seyster@mongodb.com>2022-03-07 12:08:01 -0500
commit26bab136615f5f7a5d6c35e767e2321dcc31b956 (patch)
tree63ecab22fa06e3b308f91697864f272c44152595 /src/mongo/scripting/mozjs/jsthread.cpp
parent82190f17c29d5090c16af894ec21a9b51312cc4f (diff)
downloadmongo-26bab136615f5f7a5d6c35e767e2321dcc31b956.tar.gz
SERVER-61008 Upgrade vendorized mozjs to esr91.3
Co-authored-by: Mohammad Dashti <mdashti@gmail.com>
Diffstat (limited to 'src/mongo/scripting/mozjs/jsthread.cpp')
-rw-r--r--src/mongo/scripting/mozjs/jsthread.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/scripting/mozjs/jsthread.cpp b/src/mongo/scripting/mozjs/jsthread.cpp
index 26641044afc..550a7db9c11 100644
--- a/src/mongo/scripting/mozjs/jsthread.cpp
+++ b/src/mongo/scripting/mozjs/jsthread.cpp
@@ -34,6 +34,9 @@
#include "mongo/scripting/mozjs/jsthread.h"
#include <cstdio>
+#include <js/Array.h>
+#include <js/Object.h>
+#include <jsfriendapi.h>
#include <memory>
#include <vm/PosixNSPR.h>
@@ -87,11 +90,11 @@ public:
uassert(ErrorCodes::JSInterpreterFailure, "need at least one argument", args.length() > 0);
uassert(ErrorCodes::JSInterpreterFailure,
"first argument must be a function",
- args.get(0).isObject() && JS_ObjectIsFunction(cx, args.get(0).toObjectOrNull()));
+ args.get(0).isObject() && js::IsFunctionObject(args.get(0).toObjectOrNull()));
- JS::RootedObject robj(cx, JS_NewArrayObject(cx, args));
+ JS::RootedObject robj(cx, JS::NewArrayObject(cx, args));
if (!robj) {
- uasserted(ErrorCodes::JSInterpreterFailure, "Failed to JS_NewArrayObject");
+ uasserted(ErrorCodes::JSInterpreterFailure, "Failed to JS::NewArrayObject");
}
_sharedData->_args = ObjectWrapper(cx, robj).toBSON();
@@ -222,13 +225,13 @@ JSThreadConfig* getConfig(JSContext* cx, JS::CallArgs args) {
if (!getScope(cx)->getProto<JSThreadInfo>().instanceOf(value))
uasserted(ErrorCodes::BadValue, "_JSThreadConfig is not a JSThread");
- return static_cast<JSThreadConfig*>(JS_GetPrivate(value.toObjectOrNull()));
+ return static_cast<JSThreadConfig*>(JS::GetPrivate(value.toObjectOrNull()));
}
} // namespace
-void JSThreadInfo::finalize(js::FreeOp* fop, JSObject* obj) {
- auto config = static_cast<JSThreadConfig*>(JS_GetPrivate(obj));
+void JSThreadInfo::finalize(JSFreeOp* fop, JSObject* obj) {
+ auto config = static_cast<JSThreadConfig*>(JS::GetPrivate(obj));
if (!config)
return;
@@ -242,7 +245,7 @@ void JSThreadInfo::Functions::init::call(JSContext* cx, JS::CallArgs args) {
JS::RootedObject obj(cx);
scope->getProto<JSThreadInfo>().newObject(&obj);
JSThreadConfig* config = scope->trackedNew<JSThreadConfig>(cx, args);
- JS_SetPrivate(obj, config);
+ JS::SetPrivate(obj, config);
ObjectWrapper(cx, args.thisv()).setObject(InternedString::_JSThreadConfig, obj);