Skip to content

Commit 03f2fc6

Browse files
committed
Merge branch 'oleneveu-master'
2 parents 43982e7 + ca54da7 commit 03f2fc6

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Frameworks/JsClr/Internal/CoreEx.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -217,21 +217,21 @@ JsTypes.push({ fullname: "Array", baseTypeName: "Object", definition:
217217
target.push(this[i]);
218218
}
219219
},
220-
//filter: function (pred) {
221-
// var item, i = 0;
222-
// for (var i = 0, j = this.length; i < j; i++) {
223-
// item = this[i];
224-
// if (!pred(item)) {
225-
// this.splice(i, 1);
226-
// i--; //prevent increase
227-
// j--; //length is decreased
228-
// }
229-
// }
230-
// return this;
231-
//},
232-
//filterOut: function (pred) {
233-
// return this.filter(function (item) { return !pred(item); });
234-
//},
220+
filter: function (pred, thisArg) {
221+
var item, i = 0;
222+
for (var i = 0, j = this.length; i < j; i++) {
223+
item = this[i];
224+
if (!pred.call(thisArg, item)) {
225+
this.splice(i, 1);
226+
i--; //prevent increase
227+
j--; //length is decreased
228+
}
229+
}
230+
return this;
231+
},
232+
filterOut: function (pred) {
233+
return this.filter(function (item) { return !pred(item); });
234+
},
235235
apply: function (modifier) {
236236
for (var i = 0, j = this.length; i < j; i++) {
237237
this[i] = modifier(this[i]);

0 commit comments

Comments
 (0)