Browse files

SERVER-446 make v8 undefined/null conversion same as sm

  • Loading branch information...
1 parent 0131eaf commit ad8292a9f7102a9a4f048710136f297419c5ab5a @astaple astaple committed Feb 1, 2010
Showing with 4 additions and 9 deletions.
  1. +2 −2 jstests/group2.js
  2. +2 −7 scripting/v8_wrapper.cpp
View
4 jstests/group2.js
@@ -28,11 +28,11 @@ delete cmd.key
cmd["$keyf"] = function(x){ return { a : x.a }; };
result2 = t.group( cmd );
-assert.eq( result , result2 );
+assert.eq( result , result2, "check result2" );
delete cmd.$keyf
cmd["keyf"] = function(x){ return { a : x.a }; };
result3 = t.group( cmd );
-assert.eq( result , result3 );
+assert.eq( result , result3, "check result3" );
View
9 scripting/v8_wrapper.cpp
@@ -167,6 +167,7 @@ namespace mongo {
break;
case mongo::jstNULL:
+ case mongo::Undefined: // duplicate sm behavior
o->Set( v8::String::New( f.fieldName() ) , v8::Null() );
break;
@@ -234,10 +235,6 @@ namespace mongo {
break;
}
- case mongo::Undefined:
- o->Set( v8::String::New( f.fieldName() ), v8::Undefined() );
- break;
-
case mongo::DBRef: {
v8::Function* dbPointer = getNamedCons( "DBPointer" );
v8::Handle<v8::Value> argv[2];
@@ -301,6 +298,7 @@ namespace mongo {
case mongo::EOO:
case mongo::jstNULL:
+ case mongo::Undefined: // duplicate sm behavior
return v8::Null();
case mongo::RegEx: {
@@ -360,9 +358,6 @@ namespace mongo {
return sub;
}
- case mongo::Undefined:
- return v8::Undefined();
-
case mongo::DBRef: {
v8::Function* dbPointer = getNamedCons( "DBPointer" );
v8::Handle<v8::Value> argv[2];

0 comments on commit ad8292a

Please sign in to comment.