diff options
author | Aaron <aaron@10gen.com> | 2009-12-29 18:27:49 -0800 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-12-29 18:27:49 -0800 |
commit | 8573d53da75b62e86c7b0d6b56766aa3a86f9b1b (patch) | |
tree | 4196fd31222c28f446af8573dff62cefa6a4caa3 /dbtests/jstests.cpp | |
parent | d1e3f2afe5fc8aee3e40c3c2278cf560d981526c (diff) | |
download | mongo-8573d53da75b62e86c7b0d6b56766aa3a86f9b1b.tar.gz |
SERVER-470 MINOR abstract shell init functionality so v8_utils need not link with shell
Diffstat (limited to 'dbtests/jstests.cpp')
-rw-r--r-- | dbtests/jstests.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/dbtests/jstests.cpp b/dbtests/jstests.cpp index 0b74a6b43a4..86b0218c891 100644 --- a/dbtests/jstests.cpp +++ b/dbtests/jstests.cpp @@ -47,7 +47,7 @@ namespace JSTests { public: void run(){ auto_ptr<Scope> s; - s.reset( globalScriptEngine->createScope() ); + s.reset( globalScriptEngine->newScope() ); s->setNumber( "x" , 5 ); ASSERT( 5 == s->getNumber( "x" ) ); @@ -74,7 +74,7 @@ namespace JSTests { // Not worrying about this for now SERVER-446. /* auto_ptr<Scope> s; - s.reset( globalScriptEngine->createScope() ); + s.reset( globalScriptEngine->newScope() ); s->setBoolean( "x" , true ); ASSERT( s->getBoolean( "x" ) ); @@ -88,7 +88,7 @@ namespace JSTests { class FalseTests { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); ASSERT( ! s->getBoolean( "x" ) ); @@ -103,7 +103,7 @@ namespace JSTests { class SimpleFunctions { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); s->invoke( "x=5;" , BSONObj() ); ASSERT( 5 == s->getNumber( "x" ) ); @@ -132,7 +132,7 @@ namespace JSTests { class ObjectMapping { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); BSONObj o = BSON( "x" << 17 << "y" << "eliot" << "z" << "sara" ); s->setObject( "blah" , o ); @@ -189,7 +189,7 @@ namespace JSTests { class ObjectDecoding { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); s->invoke( "z = { num : 1 };" , BSONObj() ); BSONObj out = s->getObject( "z" ); @@ -214,7 +214,7 @@ namespace JSTests { public: void run(){ #ifdef MOZJS - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); s->localConnect( "blah" ); @@ -247,7 +247,7 @@ namespace JSTests { class SetImplicit { public: void run() { - Scope *s = globalScriptEngine->createScope(); + Scope *s = globalScriptEngine->newScope(); BSONObj o = BSON( "foo" << "bar" ); s->setObject( "a.b", o ); @@ -268,7 +268,7 @@ namespace JSTests { class ObjectModReadonlyTests { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); BSONObj o = BSON( "x" << 17 << "y" << "eliot" << "z" << "sara" << "zz" << BSONObj() ); s->setObject( "blah" , o , true ); @@ -315,7 +315,7 @@ namespace JSTests { class OtherJSTypes { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); { // date BSONObj o; @@ -382,7 +382,7 @@ namespace JSTests { class SpecialDBTypes { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); BSONObjBuilder b; b.appendTimestamp( "a" , 123456789 ); @@ -418,7 +418,7 @@ namespace JSTests { class TypeConservation { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); // -- A -- @@ -527,7 +527,7 @@ namespace JSTests { } void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); s->localConnect( "blah" ); @@ -600,7 +600,7 @@ namespace JSTests { class CodeTests { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); { BSONObjBuilder b; @@ -687,7 +687,7 @@ namespace JSTests { } void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); s->localConnect( "asd" ); const char * foo = "asdas\0asdasd"; @@ -721,7 +721,7 @@ namespace JSTests { class VarTests { public: void run(){ - Scope * s = globalScriptEngine->createScope(); + Scope * s = globalScriptEngine->newScope(); ASSERT( s->exec( "a = 5;" , "a" , false , true , false ) ); ASSERT_EQUALS( 5 , s->getNumber("a" ) ); |