summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/mozjs/code.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/scripting/mozjs/code.cpp')
-rw-r--r--src/mongo/scripting/mozjs/code.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mongo/scripting/mozjs/code.cpp b/src/mongo/scripting/mozjs/code.cpp
index 701ed1d0375..b042966908d 100644
--- a/src/mongo/scripting/mozjs/code.cpp
+++ b/src/mongo/scripting/mozjs/code.cpp
@@ -42,8 +42,7 @@ namespace mongo {
namespace mozjs {
const JSFunctionSpec CodeInfo::methods[2] = {
- MONGO_ATTACH_JS_CONSTRAINED_METHOD(toString, CodeInfo),
- JS_FS_END,
+ MONGO_ATTACH_JS_CONSTRAINED_METHOD(toString, CodeInfo), JS_FS_END,
};
const char* const CodeInfo::className = "Code";
@@ -51,9 +50,9 @@ const char* const CodeInfo::className = "Code";
void CodeInfo::Functions::toString::call(JSContext* cx, JS::CallArgs args) {
ObjectWrapper o(cx, args.thisv());
- std::string str = str::stream()
- << "Code({\"code\":\"" << o.getString(InternedString::code) << "\","
- << "\"scope\":" << o.getObject(InternedString::scope) << "\"})";
+ std::string str = str::stream() << "Code({\"code\":\"" << o.getString(InternedString::code)
+ << "\","
+ << "\"scope\":" << o.getObject(InternedString::scope) << "\"})";
ValueReader(cx, args.rval()).fromStringData(str);
}
@@ -71,15 +70,13 @@ void CodeInfo::construct(JSContext* cx, JS::CallArgs args) {
if (args.length() == 0) {
o.setString(InternedString::code, "");
- }
- else if (args.length() == 1) {
+ } else if (args.length() == 1) {
JS::HandleValue codeArg = args.get(0);
if (!codeArg.isString())
uasserted(ErrorCodes::BadValue, "code must be a string");
o.setValue(InternedString::code, codeArg);
- }
- else {
+ } else {
if (!args.get(0).isString())
uasserted(ErrorCodes::BadValue, "code must be a string");
if (!args.get(1).isObject())