Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/iwyg/es5-shim into iwyg
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Aug 9, 2011
2 parents 7b6ec45 + 7a0a90f commit 2f94c76
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
24 changes: 17 additions & 7 deletions es5-shim.js
Expand Up @@ -244,14 +244,24 @@ if (!Array.prototype.every) {
}

// ES5 15.4.4.17
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
if (!Array.prototype.some) {
Array.prototype.some = function some(block /*, thisp */) {
var thisp = arguments[1];
for (var i = 0; i < this.length; i++)
if (block.call(thisp, this[i]))
return true;
return false;
};
Array.prototype.some = function (fun/*, thisp */) {
"use strict";

if (this === void 0 || this === null) throw new TypeError();

var t = Object(this);
var len = t.length >>> 0;
if (typeof fun !== "function") throw new TypeError();

var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in t && fun.call(thisp, t[i], i, t)) return true;
}

return false;
};
}

// ES5 15.4.4.21
Expand Down
14 changes: 0 additions & 14 deletions es5-shim.min.js

This file was deleted.

0 comments on commit 2f94c76

Please sign in to comment.