summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/maxkey.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/scripting/mozjs/maxkey.cpp')
-rw-r--r--src/mongo/scripting/mozjs/maxkey.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mongo/scripting/mozjs/maxkey.cpp b/src/mongo/scripting/mozjs/maxkey.cpp
index 78dae6a9719..6730da09b0d 100644
--- a/src/mongo/scripting/mozjs/maxkey.cpp
+++ b/src/mongo/scripting/mozjs/maxkey.cpp
@@ -30,6 +30,7 @@
#include "mongo/scripting/mozjs/maxkey.h"
+#include "mongo/scripting/mozjs/internedstring.h"
#include "mongo/scripting/mozjs/implscope.h"
#include "mongo/scripting/mozjs/objectwrapper.h"
#include "mongo/scripting/mozjs/valuereader.h"
@@ -44,10 +45,6 @@ const JSFunctionSpec MaxKeyInfo::methods[2] = {
const char* const MaxKeyInfo::className = "MaxKey";
-namespace {
-const char* const kSingleton = "singleton";
-} // namespace
-
void MaxKeyInfo::construct(JSContext* cx, JS::CallArgs args) {
call(cx, args);
}
@@ -64,14 +61,14 @@ void MaxKeyInfo::call(JSContext* cx, JS::CallArgs args) {
JS::RootedValue val(cx);
- if (!o.hasField(kSingleton)) {
+ if (!o.hasField(InternedString::singleton)) {
JS::RootedObject thisv(cx);
scope->getProto<MaxKeyInfo>().newObject(&thisv);
val.setObjectOrNull(thisv);
- o.setValue(kSingleton, val);
+ o.setValue(InternedString::singleton, val);
} else {
- o.getValue(kSingleton, &val);
+ o.getValue(InternedString::singleton, &val);
if (!getScope(cx)->getProto<MaxKeyInfo>().instanceOf(val))
uasserted(ErrorCodes::BadValue, "MaxKey singleton not of type MaxKey");
@@ -90,8 +87,8 @@ void MaxKeyInfo::postInstall(JSContext* cx, JS::HandleObject global, JS::HandleO
JS::RootedValue value(cx);
getScope(cx)->getProto<MaxKeyInfo>().newObject(&value);
- ObjectWrapper(cx, global).setValue("MaxKey", value);
- protoWrapper.setValue(kSingleton, value);
+ ObjectWrapper(cx, global).setValue(InternedString::MaxKey, value);
+ protoWrapper.setValue(InternedString::singleton, value);
}
} // namespace mozjs