fix null,date returns from db.eval SERVER-151

This commit is contained in:
Eliot Horowitz
2009-07-13 12:49:29 -04:00
parent c5e353874c
commit 8db5cbbea8
5 changed files with 24 additions and 1 deletions

View File

@@ -889,9 +889,13 @@ namespace mongo {
case JSTYPE_VOID: return Undefined;
case JSTYPE_NULL: return jstNULL;
case JSTYPE_OBJECT: {
if ( val == JSVAL_NULL )
return jstNULL;
JSObject * o = JSVAL_TO_OBJECT( val );
if ( JS_IsArrayObject( _context , o ) )
return Array;
if ( isDate( _context , o ) )
return Date;
return Object;
}
case JSTYPE_FUNCTION: return Code;