typos
This commit is contained in:
parent
c949b304ba
commit
77f4d8f3b9
1 changed files with 3 additions and 2 deletions
|
@ -32,7 +32,7 @@
|
|||
(col, iterator[, that], callback[, ms]) -> <u> undefined
|
||||
@*/
|
||||
Ox.nonblockingForEach = function(col, iterator, that, callback, ms) {
|
||||
var i, keys, last = Ox.last(arguments), n, time = +new Date();
|
||||
var i, keys, last = Ox.last(arguments), n, time, type = Ox.typeOf(col);
|
||||
callback = Ox.isFunction(last) ? last : arguments[arguments.length - 2];
|
||||
col = type == 'array' || type == 'object' ? col : Ox.toArray(col);
|
||||
keys = type == 'object' ? Object.keys(col) : Ox.range(col.length);
|
||||
|
@ -41,6 +41,7 @@
|
|||
that = arguments.length == 5 || (
|
||||
arguments.length == 4 && Ox.isFunction(last)
|
||||
) ? that : null;
|
||||
time = +new Date();
|
||||
iterate();
|
||||
function iterate() {
|
||||
keys[i] in col && iterator.call(that, col[keys[i]], keys[i], col, function() {
|
||||
|
@ -49,7 +50,7 @@
|
|||
iterate();
|
||||
} else {
|
||||
setTimeout(function() {
|
||||
time += new Date();
|
||||
time = +new Date();
|
||||
iterate();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue