fix Ox.getAsync

This commit is contained in:
rolux 2013-05-09 22:32:19 +02:00
parent 63667f04a0
commit 50a845fa29

View file

@ -60,9 +60,9 @@ Ox.getAsync = function(urls, get, callback) {
}
function iterate() {
var url = urls.shift();
Ox.getAsync(url, function(result, error) {
Ox.extend(results, url, result);
Ox.extend(errors, url, error);
Ox.getAsync(url, get, function(result, error) {
results[url] = result;
errors[url] = error;
urls.length ? iterate() : done();
});
}
@ -71,8 +71,8 @@ Ox.getAsync = function(urls, get, callback) {
} else {
urls.forEach(function(url) {
get(url, function(result, error) {
Ox.extend(results, url, result);
Ox.extend(errors, url, error);
results[url] = result;
errors[url] = error;
++i == n && done();
});
});