Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1 from rvagg/master

dodgy Array.prototype.filter pollyfill
  • Loading branch information...
commit 87afb9f9893ba3d0cb898aac21add69ba65dc972 2 parents a7851d0 + cd83114
Christian Johansen cjohansen authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. +4 4 lib/buster-core.js
8 lib/buster-core.js
@@ -189,18 +189,18 @@ var buster = (function (setTimeout, B) {
189 189 };
190 190 } else {
191 191 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter
192   - buster.filter = function (fn, thisp) {
  192 + buster.filter = function (arr, fn, thisp) {
193 193 "use strict";
194   - if (this == null) { throw new TypeError(); }
  194 + if (arr == null) { throw new TypeError(); }
195 195
196   - var t = Object(this);
  196 + var t = Object(arr);
197 197 var len = t.length >>> 0;
198 198 if (typeof fn != "function") { throw new TypeError(); }
199 199
200 200 var res = [];
201 201 for (var i = 0; i < len; i++) {
202 202 if (i in t) {
203   - var val = t[i]; // in case fun mutates this
  203 + var val = t[i];
204 204 if (fn.call(thisp, val, i, t)) { res.push(val); }
205 205 }
206 206 }

0 comments on commit 87afb9f

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