summaryrefslogtreecommitdiff
path: root/scripting/sm_db.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-08-28 13:27:15 -0400
committerEliot Horowitz <eliot@10gen.com>2009-08-28 13:27:15 -0400
commit3c6ec5274ac780a63ca671df479c9b2384777042 (patch)
treeb1f024f33f220f848fbaa89838c539a0f67c38e3 /scripting/sm_db.cpp
parentcd1fe6505a5c36a678b2f7c30cdb6ffdaea250a8 (diff)
downloadmongo-3c6ec5274ac780a63ca671df479c9b2384777042.tar.gz
xulrunner in ubuntu passes all client tests now
Diffstat (limited to 'scripting/sm_db.cpp')
-rw-r--r--scripting/sm_db.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripting/sm_db.cpp b/scripting/sm_db.cpp
index b390e596d0f..d0126a0dedb 100644
--- a/scripting/sm_db.cpp
+++ b/scripting/sm_db.cpp
@@ -698,6 +698,7 @@ namespace mongo {
}
#if defined( SM16 ) || defined( MOZJS )
+#warning dates do not work in your version of spider monkey
{
jsdouble d = js_DateGetMsecSinceEpoch( c->_context , o );
if ( d ){
@@ -705,8 +706,14 @@ namespace mongo {
return true;
}
}
+#elif defined( XULRUNNER )
+ if ( JS_InstanceOf( c->_context , o, globalSMEngine->_dateClass , 0 ) ){
+ jsdouble d = js_DateGetMsecSinceEpoch( c->_context , o );
+ b.appendDate( name.c_str() , (unsigned long long)d );
+ return true;
+ }
#else
- if ( JS_InstanceOf( c->_context , o, &js_DateClass, 0 ) ){
+ if ( JS_InstanceOf( c->_context , o, &js_DateClass_ , 0 ) ){
jsdouble d = js_DateGetMsecSinceEpoch( c->_context , o );
b.appendDate( name.c_str() , (unsigned long long)d );
return true;
@@ -721,7 +728,12 @@ namespace mongo {
return true;
}
-#ifdef SM18
+#if defined( XULRUNNER )
+ if ( JS_InstanceOf( c->_context , o , globalSMEngine->_regexClass , 0 ) ){
+ c->appendRegex( b , name , c->toString( val ) );
+ return true;
+ }
+#elif defined( SM18 )
if ( JS_InstanceOf( c->_context , o , &js_RegExpClass , 0 ) ){
c->appendRegex( b , name , c->toString( val ) );
return true;
@@ -732,7 +744,7 @@ namespace mongo {
}
bool isDate( JSContext * cx , JSObject * o ){
-#if defined( SM16 ) || defined( MOZJS )
+#if defined( SM16 ) || defined( MOZJS ) || defined( XULRUNNER )
return js_DateGetMsecSinceEpoch( cx , o ) != 0;
#else
return JS_InstanceOf( cx , o, &js_DateClass, 0 );