Fix Ox.Request.cancel(fn) (fixes #2932)
arguments[0] === req inside the forEach callback, so previously this would throw TypeError: arguments[0] is not a function
This commit is contained in:
parent
af610a0df9
commit
869de36163
1 changed files with 2 additions and 1 deletions
|
@ -48,8 +48,9 @@ Ox.Request = (function() {
|
||||||
requests = {};
|
requests = {};
|
||||||
} else if (Ox.isFunction(arguments[0])) {
|
} else if (Ox.isFunction(arguments[0])) {
|
||||||
// cancel with function
|
// cancel with function
|
||||||
|
var fn = arguments[0];
|
||||||
Ox.forEach(requests, function(req, id) {
|
Ox.forEach(requests, function(req, id) {
|
||||||
if (arguments[0](req)) {
|
if (fn(req)) {
|
||||||
delete requests[id];
|
delete requests[id];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue