summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/bson.cpp
diff options
context:
space:
mode:
authorJason Carey <jcarey@argv.me>2015-09-14 14:18:35 -0400
committerJason Carey <jcarey@argv.me>2015-09-17 19:59:38 -0400
commit8291bbb3a6ec192d177076b1fb0cd28995e48440 (patch)
tree5cfb11b9cc1752c9967473c71b957188499b4fce /src/mongo/scripting/mozjs/bson.cpp
parent1b0e65b0ccd5725f97b0a679ac7f7476a242c66e (diff)
downloadmongo-8291bbb3a6ec192d177076b1fb0cd28995e48440.tar.gz
SERVER-20080 Constrain ctor calls for JS types
Several types shouldn't be called as a ctor: * NativeFunction * Cursor * CursorHandle * NativeFunction This prevents them from being called as such.
Diffstat (limited to 'src/mongo/scripting/mozjs/bson.cpp')
-rw-r--r--src/mongo/scripting/mozjs/bson.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/mongo/scripting/mozjs/bson.cpp b/src/mongo/scripting/mozjs/bson.cpp
index 308e29d90f3..9c972a6b3fc 100644
--- a/src/mongo/scripting/mozjs/bson.cpp
+++ b/src/mongo/scripting/mozjs/bson.cpp
@@ -75,7 +75,7 @@ BSONHolder* getHolder(JSObject* obj) {
void BSONInfo::make(JSContext* cx, JS::MutableHandleObject obj, BSONObj bson, bool ro) {
auto scope = getScope(cx);
- scope->getBsonProto().newInstance(obj);
+ scope->getBsonProto().newObject(obj);
JS_SetPrivate(obj, new BSONHolder(bson, ro));
}
@@ -193,12 +193,6 @@ void BSONInfo::resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, boo
}
}
-void BSONInfo::construct(JSContext* cx, JS::CallArgs args) {
- auto scope = getScope(cx);
-
- scope->getBsonProto().newObject(args.rval());
-}
-
std::tuple<BSONObj*, bool> BSONInfo::originalBSON(JSContext* cx, JS::HandleObject obj) {
std::tuple<BSONObj*, bool> out(nullptr, false);