summaryrefslogtreecommitdiff
path: root/src/mongo/scripting/v8_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/scripting/v8_utils.cpp')
-rw-r--r--src/mongo/scripting/v8_utils.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mongo/scripting/v8_utils.cpp b/src/mongo/scripting/v8_utils.cpp
index fa6099d61e1..ec6357e99a4 100644
--- a/src/mongo/scripting/v8_utils.cpp
+++ b/src/mongo/scripting/v8_utils.cpp
@@ -35,10 +35,7 @@ using namespace std;
namespace mongo {
std::string toSTLString(const v8::Handle<v8::Value>& o) {
- v8::String::Utf8Value str(o);
- massert(16686, "error converting js type to Utf8Value", *str);
- std::string s(*str, str.length());
- return s;
+ return StringData(V8String(o)).toString();
}
/** Get the properties of an object (and its prototype) as a comma-delimited string */
@@ -96,7 +93,7 @@ namespace mongo {
// arguments need to be copied into the isolate, go through bson
BSONObjBuilder b;
for(int i = 0; i < args.Length(); ++i) {
- scope->v8ToMongoElement(b, mongoutils::str::stream() << "arg" << i, args[i]);
+ scope->v8ToMongoElement(b, "arg" + BSONObjBuilder::numStr(i), args[i]);
}
_args = b.obj();
}