mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update std.js
This commit is contained in:
parent
6615efbd19
commit
9516a7f60d
16
lib/std.js
16
lib/std.js
|
@ -114,20 +114,22 @@ function repeat(target, callback, onError) {
|
|||
if (typeof WScript !== "undefined") {
|
||||
while (ms === true ? true : (cur < end)) {
|
||||
try {
|
||||
if (typeof callback === "function")
|
||||
if (typeof callback === "function") {
|
||||
var result = callback(i);
|
||||
if (typeof result === "number") {
|
||||
i += result;
|
||||
} else if (result === false) {
|
||||
break;
|
||||
} else if (result === true) {
|
||||
i += 1;
|
||||
}
|
||||
;
|
||||
}
|
||||
} catch (e) {
|
||||
if (typeof onError === "function")
|
||||
if (onError(e) === false)
|
||||
break
|
||||
;
|
||||
;
|
||||
if (typeof onError === "function") {
|
||||
if (onError(e) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cur = Date.now();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user