summaryrefslogtreecommitdiff
path: root/scripting/engine_v8.cpp
diff options
context:
space:
mode:
authoragirbal <antoine@10gen.com>2011-05-30 16:29:48 -0700
committeragirbal <antoine@10gen.com>2011-05-30 16:29:48 -0700
commit8aeaf8d850d65c934cc5269e4c78a0eb138e9183 (patch)
tree8f3ecbd3e143f860aec4538a176ceab72c7c5f61 /scripting/engine_v8.cpp
parente371c76ccac4f166b7f267114526a6c8b073f5de (diff)
downloadmongo-8aeaf8d850d65c934cc5269e4c78a0eb138e9183.tar.gz
SERVER-3168: added UUID type and method. Fixed conversion to BSON.
Diffstat (limited to 'scripting/engine_v8.cpp')
-rw-r--r--scripting/engine_v8.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/scripting/engine_v8.cpp b/scripting/engine_v8.cpp
index 968b253c896..de9655d46e8 100644
--- a/scripting/engine_v8.cpp
+++ b/scripting/engine_v8.cpp
@@ -1343,9 +1343,8 @@ namespace mongo {
}
else if ( !value->ToObject()->GetHiddenValue( V8STR_BINDATA ).IsEmpty() ) {
int len = obj->Get( getV8Str( "len" ) )->ToInt32()->Value();
- v8::String::Utf8Value data( obj->Get( getV8Str( "data" ) ) );
- const char *dataArray = *data;
- assert( data.length() == len );
+ Local<External> c = External::Cast( *(obj->GetInternalField( 0 )) );
+ const char* dataArray = (char*)(c->Value());;
b.appendBinData( sname,
len,
mongo::BinDataType( obj->Get( getV8Str( "type" ) )->ToInt32()->Value() ),