diff options
Diffstat (limited to 'src/mongo/scripting/mozjs/status.cpp')
-rw-r--r-- | src/mongo/scripting/mozjs/status.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/scripting/mozjs/status.cpp b/src/mongo/scripting/mozjs/status.cpp index 0062799e839..0fc7e5e3df3 100644 --- a/src/mongo/scripting/mozjs/status.cpp +++ b/src/mongo/scripting/mozjs/status.cpp @@ -67,25 +67,24 @@ void MongoStatusInfo::fromStatus(JSContext* cx, Status status, JS::MutableHandle JS::RootedObject thisv(cx); scope->getProto<MongoStatusInfo>().newObjectWithProto(&thisv, error); ObjectWrapper thisvObj(cx, thisv); - thisvObj.defineProperty( - InternedString::code, - undef, - JSPROP_ENUMERATE | JSPROP_SHARED, - smUtils::wrapConstrainedMethod<Functions::code, false, MongoStatusInfo>); + thisvObj.defineProperty(InternedString::code, + JSPROP_ENUMERATE, + smUtils::wrapConstrainedMethod<Functions::code, false, MongoStatusInfo>, + nullptr); thisvObj.defineProperty( InternedString::reason, - undef, - JSPROP_ENUMERATE | JSPROP_SHARED, - smUtils::wrapConstrainedMethod<Functions::reason, false, MongoStatusInfo>); + JSPROP_ENUMERATE, + smUtils::wrapConstrainedMethod<Functions::reason, false, MongoStatusInfo>, + nullptr); // We intentionally omit JSPROP_ENUMERATE to match how Error.prototype.stack is a non-enumerable // property. thisvObj.defineProperty( InternedString::stack, - undef, - JSPROP_SHARED, - smUtils::wrapConstrainedMethod<Functions::stack, false, MongoStatusInfo>); + 0, + smUtils::wrapConstrainedMethod<Functions::stack, false, MongoStatusInfo>, + nullptr); JS_SetPrivate(thisv, scope->trackedNew<Status>(std::move(status))); @@ -102,7 +101,7 @@ void MongoStatusInfo::construct(JSContext* cx, JS::CallArgs args) { args.rval().set(out); } -void MongoStatusInfo::finalize(JSFreeOp* fop, JSObject* obj) { +void MongoStatusInfo::finalize(js::FreeOp* fop, JSObject* obj) { auto status = static_cast<Status*>(JS_GetPrivate(obj)); if (status) @@ -138,7 +137,8 @@ void MongoStatusInfo::Functions::stack::call(JSContext* cx, JS::CallArgs args) { .fromStringData(extraInfo->stack + parentWrapper.getString(InternedString::stack)); // We redefine the "stack" property as the combined JavaScript stacktrace. It is important - // that we omit JSPROP_SHARED to the thisvObj.defineProperty() call in order to have + // that we omit (TODO/FIXME, no more JSPROP_SHARED) JSPROP_SHARED to the + // thisvObj.defineProperty() call in order to have // SpiderMonkey allocate memory for the string value. We also intentionally omit // JSPROP_ENUMERATE to match how Error.prototype.stack is a non-enumerable property. ObjectWrapper thisvObj(cx, args.thisv()); |