make sure db doesn't crash with weird db.eval returns SERVER-159

This commit is contained in:
Eliot Horowitz
2009-07-15 11:41:23 -04:00
parent 2d8e4fd3a0
commit 294f9e4873
3 changed files with 43 additions and 21 deletions

View File

@@ -688,7 +688,7 @@ namespace mongo {
);
return true;
}
#if defined( SM16 ) || defined( MOZJS )
{
jsdouble d = js_DateGetMsecSinceEpoch( c->_context , o );
@@ -705,6 +705,14 @@ namespace mongo {
}
#endif
if ( JS_InstanceOf( c->_context , o , &dbquery_class , 0 ) ||
JS_InstanceOf( c->_context , o , &mongo_class , 0 ) ||
JS_InstanceOf( c->_context , o , &db_collection_class , 0 ) ){
b.append( name.c_str() , c->toString( OBJECT_TO_JSVAL(o) ) );
return true;
}
return false;
}
@@ -716,5 +724,5 @@ namespace mongo {
return JS_InstanceOf( cx , o, &js_DateClass, 0 );
#endif
}
}