fix: test

This commit is contained in:
Felix Roos 2024-02-04 23:32:28 +01:00
parent cea33783a2
commit 0baa8383f2

View file

@ -227,7 +227,8 @@ const processMessage = (message) => {
} }
}; };
self.onconnect = function (e) { if (typeof self !== 'undefined') {
self.onconnect = function (e) {
// the incoming port // the incoming port
const port = e.ports[0]; const port = e.ports[0];
allPorts.push(port); allPorts.push(port);
@ -235,7 +236,8 @@ self.onconnect = function (e) {
processMessage(e.data); processMessage(e.data);
}); });
port.start(); // Required when using addEventListener. Otherwise called implicitly by onmessage setter. port.start(); // Required when using addEventListener. Otherwise called implicitly by onmessage setter.
}; };
}
function createClock( function createClock(
callback, // called slightly before each cycle callback, // called slightly before each cycle