Update std.js

This commit is contained in:
Namhyeon Go 2022-02-21 07:17:48 +09:00 committed by GitHub
parent 6615efbd19
commit 9516a7f60d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}