0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

SERVER-446 implement keySet w/o array comprehension, since v8 doesn't support that

This commit is contained in:
Aaron 2009-12-21 11:34:02 -08:00
parent 92212a0cd2
commit e7e790ee96

View File

@ -273,7 +273,13 @@ Array.stdDev = function( arr ){
}
Object.keySet = function( o ) {
return [i for (i in o) if ( !( i in o.__proto__ && o[ i ] === o.__proto__[ i ] ) )];
var ret = new Array();
for( i in o ) {
if ( !( i in o.__proto__ && o[ i ] === o.__proto__[ i ] ) ) {
ret.push( i );
}
}
return ret;
}
if ( ! ObjectId.prototype )