mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update fakeworker.js
This commit is contained in:
parent
2ce0c4b637
commit
f29556ed14
|
@ -117,7 +117,7 @@ exports.create = function() {
|
|||
return new FakeWorker();
|
||||
};
|
||||
|
||||
exports.repeat = function(target, worker) {
|
||||
exports.repeat = function(target, worker, onError) {
|
||||
if (!(worker instanceof FakeWorker)) return;
|
||||
|
||||
if (["number", "boolean"].indexOf(typeof target) > -1) {
|
||||
|
@ -129,7 +129,7 @@ exports.repeat = function(target, worker) {
|
|||
var intervals = worker.getIntervals();
|
||||
for (var i = 0; i < intervals.length; i++) {
|
||||
try {
|
||||
if (typeof intervals[i].code === "function") x.code(i);
|
||||
if (typeof intervals[i].code === "function") intervals[i].code(i);
|
||||
} catch (e) {
|
||||
if (typeof onError === "function") onError(e, i);
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ exports.repeat = function(target, worker) {
|
|||
return end;
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "FakeWorker module (fakeworker.js) version 0.0.2";
|
||||
exports.VERSIONINFO = "FakeWorker module (fakeworker.js) version 0.0.3";
|
||||
exports.AUTHOR = "catswords@protonmail.com";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user