summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/status.cpp
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2019-01-29 23:16:33 +0000
committerGabriel Russell <gabriel.russell@mongodb.com>2019-01-29 23:16:33 +0000
commit254fff93270089e8ac33be3f7e079aa8bfc3f7bc (patch)
treeef7f69b2cacc081a16b4da1b58c327f29ae0b8b4 /src/mongo/scripting/mozjs/status.cpp
parenta3d232b697dfc7c8833fc1855abbc190fe0d5970 (diff)
downloadmongo-254fff93270089e8ac33be3f7e079aa8bfc3f7bc.tar.gz
Revert "SERVER-29286 import and use mozjs-60"
This reverts commit a3d232b697dfc7c8833fc1855abbc190fe0d5970.
Diffstat (limited to 'src/mongo/scripting/mozjs/status.cpp')
-rw-r--r--src/mongo/scripting/mozjs/status.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/scripting/mozjs/status.cpp b/src/mongo/scripting/mozjs/status.cpp
index 0fc7e5e3df3..0062799e839 100644
--- a/src/mongo/scripting/mozjs/status.cpp
+++ b/src/mongo/scripting/mozjs/status.cpp
@@ -67,24 +67,25 @@ 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,
- JSPROP_ENUMERATE,
- smUtils::wrapConstrainedMethod<Functions::code, false, MongoStatusInfo>,
- nullptr);
+ thisvObj.defineProperty(
+ InternedString::code,
+ undef,
+ JSPROP_ENUMERATE | JSPROP_SHARED,
+ smUtils::wrapConstrainedMethod<Functions::code, false, MongoStatusInfo>);
thisvObj.defineProperty(
InternedString::reason,
- JSPROP_ENUMERATE,
- smUtils::wrapConstrainedMethod<Functions::reason, false, MongoStatusInfo>,
- nullptr);
+ undef,
+ JSPROP_ENUMERATE | JSPROP_SHARED,
+ smUtils::wrapConstrainedMethod<Functions::reason, false, MongoStatusInfo>);
// We intentionally omit JSPROP_ENUMERATE to match how Error.prototype.stack is a non-enumerable
// property.
thisvObj.defineProperty(
InternedString::stack,
- 0,
- smUtils::wrapConstrainedMethod<Functions::stack, false, MongoStatusInfo>,
- nullptr);
+ undef,
+ JSPROP_SHARED,
+ smUtils::wrapConstrainedMethod<Functions::stack, false, MongoStatusInfo>);
JS_SetPrivate(thisv, scope->trackedNew<Status>(std::move(status)));
@@ -101,7 +102,7 @@ void MongoStatusInfo::construct(JSContext* cx, JS::CallArgs args) {
args.rval().set(out);
}
-void MongoStatusInfo::finalize(js::FreeOp* fop, JSObject* obj) {
+void MongoStatusInfo::finalize(JSFreeOp* fop, JSObject* obj) {
auto status = static_cast<Status*>(JS_GetPrivate(obj));
if (status)
@@ -137,8 +138,7 @@ 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 (TODO/FIXME, no more JSPROP_SHARED) JSPROP_SHARED to the
- // thisvObj.defineProperty() call in order to have
+ // that we omit 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());