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