In both of these cases, the ep variable is the scope, and in some cases there'll be a start() method available, and we want to call it. I'm not sure exactly why - such a method doesn't show up in GlobalWorkerScope but maybe it's somewhere else.
However, there might also just be a variable called start in your global scope, and it isn't a function, and Comlink will expect it to be callable. This PR compensates for that case by making sure that the value is a function before calling it.
In both of these cases, the
ep
variable is the scope, and in some cases there'll be astart()
method available, and we want to call it. I'm not sure exactly why - such a method doesn't show up in GlobalWorkerScope but maybe it's somewhere else.However, there might also just be a variable called
start
in your global scope, and it isn't a function, and Comlink will expect it to be callable. This PR compensates for that case by making sure that the value is a function before calling it.