Skip to content

Commit

Permalink
Add map shim for IE8
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Aug 1, 2012
1 parent 677297a commit 8c27026
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions support/browserify/30_extensions.js
Expand Up @@ -28,6 +28,17 @@ if (!Array.prototype.forEach) {
};
}

if (!Array.prototype.map) {
Array.prototype.map = function (iterator, context) {
var result = [];
context = context || this;
this.forEach(function (val, key) {
result.push(iterator.call(context, val, key));
});
return result;
};
}

if (!Function.prototype.bind) {
Function.prototype.bind = function bind(context) {
var func = this;
Expand Down

0 comments on commit 8c27026

Please sign in to comment.