diff --git a/scripting/engine.h b/scripting/engine.h index 29c2065e9d8..39460588a78 100644 --- a/scripting/engine.h +++ b/scripting/engine.h @@ -25,7 +25,7 @@ namespace mongo { } virtual void localConnect( const char * dbName ) = 0; - virtual void externalSetup( bool debug ) = 0; + virtual void externalSetup( bool master ) = 0; virtual double getNumber( const char *field ) = 0; virtual string getString( const char *field ) = 0; diff --git a/scripting/engine_spidermonkey.cpp b/scripting/engine_spidermonkey.cpp index 4940a1ff16e..1672a88f01c 100644 --- a/scripting/engine_spidermonkey.cpp +++ b/scripting/engine_spidermonkey.cpp @@ -655,8 +655,8 @@ namespace mongo { } - void externalSetup( bool debug ){ - initMongoJS( this , _context , _global , false, debug ); + void externalSetup( bool master ){ + initMongoJS( this , _context , _global , false, master ); } void localConnect( const char * dbName ){ diff --git a/scripting/sm_db.cpp b/scripting/sm_db.cpp index 53caa947bef..948b6d29c4e 100644 --- a/scripting/sm_db.cpp +++ b/scripting/sm_db.cpp @@ -612,7 +612,7 @@ namespace mongo { // ---- other stuff ---- - void initMongoJS( SMScope * scope , JSContext * cx , JSObject * global , bool local, bool debug ){ + void initMongoJS( SMScope * scope , JSContext * cx , JSObject * global , bool local, bool master ){ assert( JS_InitClass( cx , global , 0 , &mongo_class , local ? mongo_local_constructor : mongo_external_constructor , 0 , 0 , mongo_functions , 0 , 0 ) ); @@ -627,9 +627,7 @@ namespace mongo { assert( JS_InitClass( cx , global , 0 , &minkey_class , 0 , 0 , 0 , 0 , 0 , 0 ) ); assert( JS_InitClass( cx , global , 0 , &maxkey_class , 0 , 0 , 0 , 0 , 0 , 0 ) ); - - - if ( !debug ) { + if ( master ) { scope->exec( jsconcatcode ); } } diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp index 1f350bc84ea..1296d8d6e0d 100644 --- a/shell/dbshell.cpp +++ b/shell/dbshell.cpp @@ -240,7 +240,7 @@ int main(int argc, char* argv[]) { break; } - scope->externalSetup( false ); + scope->externalSetup( true ); mongo::shellUtils::installShellUtils( *scope ); if ( !nodb ) { // connect to db