0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

don't require constructor to be set SERVER-1118

This commit is contained in:
Eliot Horowitz 2010-05-14 10:05:46 -04:00
parent 2e73b896a0
commit 2dbdcf9e4c

View File

@ -647,7 +647,7 @@ tojsonObject = function( x, indent , nolint ){
return x.tojson(indent,nolint); return x.tojson(indent,nolint);
} }
if ( typeof( x.constructor.tojson ) == "function" && x.constructor.tojson != tojson ) { if ( x.constructor && typeof( x.constructor.tojson ) == "function" && x.constructor.tojson != tojson ) {
return x.constructor.tojson( x, indent , nolint ); return x.constructor.tojson( x, indent , nolint );
} }