Skip to content

Commit

Permalink
backwards compatibile js timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed May 15, 2009
1 parent d21ef69 commit 0516fad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripting/engine_spidermonkey.cpp
Expand Up @@ -317,8 +317,8 @@ namespace mongo {

case Timestamp: {
JSObject * o = JS_NewObject( _context , &timestamp_class , 0 , 0 );
setProperty( o , "time" , toval( (double)(e.timestampTime()) ) );
setProperty( o , "inc" , toval( (double)(e.timestampInc()) ) );
setProperty( o , "t" , toval( (double)(e.timestampTime()) ) );
setProperty( o , "i" , toval( (double)(e.timestampInc()) ) );
return OBJECT_TO_JSVAL( o );
}

Expand Down
2 changes: 1 addition & 1 deletion scripting/sm_db.cpp
Expand Up @@ -652,7 +652,7 @@ namespace mongo {
}

if ( JS_InstanceOf( c->_context , o , &timestamp_class , 0 ) ){
b.appendTimestamp( name.c_str() , (unsigned long long)c->getNumber( o , "time" ) , (unsigned int )c->getNumber( o , "inc" ) );
b.appendTimestamp( name.c_str() , (unsigned long long)c->getNumber( o , "t" ) , (unsigned int )c->getNumber( o , "i" ) );
return true;
}

Expand Down

0 comments on commit 0516fad

Please sign in to comment.