Skip to content
Browse files

- use feature testing for additional enumeration in Joose.O.each

  • Loading branch information...
1 parent de092a7 commit 4aa55184257fa02c24273d0fb3d8847a6adb5316 @SamuraiJack SamuraiJack committed
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/Joose.js
View
11 lib/Joose.js
@@ -117,6 +117,13 @@ Joose.S = {
var baseFunc = function () {}
+var enumProps = [ 'hasOwnProperty', 'valueOf', 'toString', 'constructor' ]
+
+var manualEnum = true
+
+for (var i in { toString : 1 }) manualEnum = false
+
+
// Static helpers for objects
Joose.O = {
@@ -126,8 +133,8 @@ Joose.O = {
for (var i in object)
if (func.call(scope, object[i], i) === false) return false
- if (Joose.is_IE)
- return Joose.A.each([ 'toString', 'constructor', 'hasOwnProperty' ], function (el) {
+ if (manualEnum)
+ return Joose.A.each(enumProps, function (el) {
if (object.hasOwnProperty(el)) return func.call(scope, object[el], el)
})

0 comments on commit 4aa5518

Please sign in to comment.
Something went wrong with that request. Please try again.