Skip to content

Commit

Permalink
fix(resource): more reliable obj.forEach check
Browse files Browse the repository at this point in the history
When undefined (IE8), obj.forEach === Array.prototype.forEach equals
true (undefined === undefined)
  • Loading branch information
robinComa authored and passy committed Sep 3, 2014
1 parent b18575c commit fd4e1c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/amd/hyperagent/miniscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define("/hyperagent/miniscore",
return;
}

if (obj.forEach === Array.prototype.forEach) {
if (obj.forEach && obj.forEach === Array.prototype.forEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, l = obj.length; i < l; i++) {
Expand Down Expand Up @@ -95,4 +95,4 @@ define("/hyperagent/miniscore",
};

__exports__._ = _;
});
});

0 comments on commit fd4e1c1

Please sign in to comment.