Skip to content

Commit

Permalink
fix shell printing
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Jun 12, 2009
1 parent 8b61455 commit a4a895e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions scripting/engine_spidermonkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@ namespace mongo {
// already printed in reportError, so... TODO
}

if ( worked )
_convertor->setProperty( _global , "__lastres__" , ret );

if ( worked && printResult && ! JSVAL_IS_VOID( ret ) )
cout << _convertor->toString( ret ) << endl;

Expand Down
6 changes: 4 additions & 2 deletions shell/dbshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ int main(int argc, char* argv[]) {

}

if ( ! wascmd )
scope->exec( code.c_str() , "(shell)" , true , true , false );
if ( ! wascmd ){
scope->exec( code.c_str() , "(shell)" , false , true , false );
scope->exec( "shellPrintHelper( __lastres__ );" , "(shell2)" , true , true , false );
}


shellHistoryAdd( line );
Expand Down

0 comments on commit a4a895e

Please sign in to comment.