0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

SpiderMonkey: arary out fix

This commit is contained in:
Eliot Horowitz 2009-05-08 16:57:41 -04:00
parent 5c96e81008
commit d6f699c687

View File

@ -92,8 +92,15 @@ namespace mongo {
case JSTYPE_OBJECT: {
JSObject * o = JSVAL_TO_OBJECT( val );
if ( ! appendSpecialDBObject( this , b , name , o ) )
b.append( name.c_str() , toObject( o ) );
if ( ! appendSpecialDBObject( this , b , name , o ) ){
BSONObj sub = toObject( o );
if ( JS_IsArrayObject( _context , o ) ){
b.appendArray( name.c_str() , sub );
}
else {
b.append( name.c_str() , sub );
}
}
break;
}
case JSTYPE_FUNCTION: b.appendCode( name.c_str() , getFunctionCode( val ).c_str() ); break;