mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
cleanup: rm iQ.grep; using .filter instead.
This commit is contained in:
parent
0782572076
commit
426e63d8c5
@ -996,22 +996,6 @@ iQ.extend({
|
||||
return first;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: grep
|
||||
grep: function( elems, callback, inv ) {
|
||||
var ret = [];
|
||||
|
||||
// Go through the array, only saving the items
|
||||
// that pass the validator function
|
||||
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
||||
if ( !inv !== !callback( elems[ i ], i ) ) {
|
||||
ret.push( elems[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: timeout
|
||||
// wraps setTimeout with try/catch
|
||||
|
@ -386,7 +386,7 @@ window.Subscribable.prototype = {
|
||||
this.subscribers[eventName] = [];
|
||||
|
||||
var subs = this.subscribers[eventName];
|
||||
var existing = iQ.grep(subs, function(element) {
|
||||
var existing = subs.filter(function(element) {
|
||||
return element.refObject == refObject;
|
||||
});
|
||||
|
||||
@ -408,9 +408,9 @@ window.Subscribable.prototype = {
|
||||
if (!this.subscribers[eventName])
|
||||
return;
|
||||
|
||||
this.subscribers[eventName] = iQ.grep(this.subscribers[eventName], function(element) {
|
||||
return element.refObject == refObject;
|
||||
}, true);
|
||||
this.subscribers[eventName] = this.subscribers[eventName].filter(function(element) {
|
||||
return element.refObject != refObject;
|
||||
});
|
||||
},
|
||||
|
||||
// ----------
|
||||
@ -458,8 +458,8 @@ window.Subscribable.prototype = {
|
||||
return;
|
||||
|
||||
this.onCloseSubscribers = this.onCloseSubscribers.filter(function(element) {
|
||||
return element.referenceElement == referenceElement;
|
||||
}, true);
|
||||
return element.referenceElement != referenceElement;
|
||||
});
|
||||
},
|
||||
|
||||
// ----------
|
||||
|
Loading…
Reference in New Issue
Block a user