From 5a0f55c194bb6a35063197990bc9be108f47540f Mon Sep 17 00:00:00 2001 From: Olivier Leneveu Date: Wed, 17 Jun 2015 12:18:37 +0200 Subject: [PATCH] Include the 'thisArg' parameter to the Array.filter methode defined in jsclr.js --- Frameworks/JsClr/Internal/CoreEx.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Frameworks/JsClr/Internal/CoreEx.js b/Frameworks/JsClr/Internal/CoreEx.js index af2af72..ee3559f 100644 --- a/Frameworks/JsClr/Internal/CoreEx.js +++ b/Frameworks/JsClr/Internal/CoreEx.js @@ -217,17 +217,17 @@ JsTypes.push({ fullname: "Array", baseTypeName: "Object", definition: target.push(this[i]); } }, - filter: function (pred) { - var item, i = 0; - for (var i = 0, j = this.length; i < j; i++) { - item = this[i]; - if (!pred(item)) { - this.splice(i, 1); - i--; //prevent increase - j--; //length is decreased - } - } - return this; + filter: function (pred, thisArg) { + var item, i = 0; + for (var i = 0, j = this.length; i < j; i++) { + item = this[i]; + if (!pred.call(thisArg, item)) { + this.splice(i, 1); + i--; //prevent increase + j--; //length is decreased + } + } + return this; }, filterOut: function (pred) { return this.filter(function (item) { return !pred(item); });