mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-06-18 02:59:04 +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") {
|
if (typeof WScript !== "undefined") {
|
||||||
while (ms === true ? true : (cur < end)) {
|
while (ms === true ? true : (cur < end)) {
|
||||||
try {
|
try {
|
||||||
if (typeof callback === "function")
|
if (typeof callback === "function") {
|
||||||
var result = callback(i);
|
var result = callback(i);
|
||||||
if (typeof result === "number") {
|
if (typeof result === "number") {
|
||||||
i += result;
|
i += result;
|
||||||
} else if (result === false) {
|
} else if (result === false) {
|
||||||
break;
|
break;
|
||||||
|
} else if (result === true) {
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (typeof onError === "function")
|
if (typeof onError === "function") {
|
||||||
if (onError(e) === false)
|
if (onError(e) === false) {
|
||||||
break
|
break;
|
||||||
;
|
}
|
||||||
;
|
}
|
||||||
}
|
}
|
||||||
cur = Date.now();
|
cur = Date.now();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user