Skip to content

Commit 5350a2f

Browse files
committed
remove broken IE hack-arounds ... IE8 failing tests down to 14
1 parent 194017c commit 5350a2f

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

underscore.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -892,33 +892,13 @@
892892
// Object Functions
893893
// ----------------
894894

895-
// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
896-
var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
897-
var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString',
898-
'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
899-
900-
function collectNonEnumProps(obj, keys) {
901-
var nonEnumIdx = nonEnumerableProps.length;
902-
var proto = typeof obj.constructor === 'function' ? FuncProto : ObjProto;
903-
904-
while (nonEnumIdx--) {
905-
var prop = nonEnumerableProps[nonEnumIdx];
906-
if (prop === 'constructor' ? _.has(obj, prop) : prop in obj &&
907-
obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
908-
keys.push(prop);
909-
}
910-
}
911-
}
912-
913895
// Retrieve the names of an object's own properties.
914896
// Delegates to **ECMAScript 5**'s native `Object.keys`
915897
_.keys = function(obj) {
916898
if (!_.isObject(obj)) return [];
917899
if (nativeKeys) return nativeKeys(obj);
918900
var keys = [];
919901
for (var key in obj) if (_.has(obj, key)) keys.push(key);
920-
// Ahem, IE < 9.
921-
if (hasEnumBug) collectNonEnumProps(obj, keys);
922902
return keys;
923903
};
924904

@@ -927,8 +907,6 @@
927907
if (!_.isObject(obj)) return [];
928908
var keys = [];
929909
for (var key in obj) keys.push(key);
930-
// Ahem, IE < 9.
931-
if (hasEnumBug) collectNonEnumProps(obj, keys);
932910
return keys;
933911
};
934912

0 commit comments

Comments
 (0)