Skip to content

Commit

Permalink
SERVER-4743: use the bsonHolder for metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
agirbal committed Jan 26, 2012
1 parent 62f2689 commit 0f66d40
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mongo/scripting/engine_v8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,6 @@ namespace mongo {

if (readOnly) {
o = roObjectTemplate->NewInstance();
o->SetHiddenValue(V8STR_RO, v8::Boolean::New(true));
} else {
if (array) {
o = lzArrayTemplate->NewInstance();
Expand Down Expand Up @@ -1497,9 +1496,8 @@ namespace mongo {
if (o->InternalFieldCount() > 0) {
originalBSON = unwrapBSONObj(o);
BSONHolder* holder = unwrapHolder(o);
if ( !o->GetHiddenValue( V8STR_RO ).IsEmpty() ||
( o->HasNamedLookupInterceptor() && !holder->_modified ) ) {
// object was readonly, use bson as is
if ( o->HasNamedLookupInterceptor() && !holder->_modified ) {
// object was not modified, use bson as is
return originalBSON;
}
}
Expand Down

0 comments on commit 0f66d40

Please sign in to comment.