Update fakeworker.js

This commit is contained in:
Namhyeon Go 2022-11-14 17:06:25 +09:00 committed by GitHub
parent e91d9bd859
commit 8f09b72712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ function FakeWorker() {
this.__intervals__.push({
'id': this.__lastIntervalID__,
'code': code,
'delay': delay,
'delay': 0, // replace to the callback
'arguments': [],
'timestamp': Date.now(),
'cleared': false,
@ -93,6 +93,7 @@ function FakeWorker() {
this.__intervals__[i].delay = this.__intervals__[i].callback();
}
}
cur = Date.now();
}
return intervals;
@ -107,6 +108,7 @@ function FakeWorker() {
timeouts.push(this.__timeouts__[i]);
this.__timeouts__[i].cleared = true;
}
cur = Date.now();
}
return timeouts;
@ -133,17 +135,17 @@ exports.repeat = function(target, worker, onError) {
} catch (e) {
if (typeof onError === "function") onError(e, i);
}
cur = Date.now();
};
cur = Date.now();
}
end = Date.now();
end = cur;
}
return end;
};
exports.VERSIONINFO = "FakeWorker module (fakeworker.js) version 0.0.3";
exports.VERSIONINFO = "FakeWorker module (fakeworker.js) version 0.0.4";
exports.AUTHOR = "catswords@protonmail.com";
exports.global = global;
exports.require = global.require;