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