Running inside web-worker window is undefined
Closed this issue · 2 comments
thiagofelix commented
When running in the context of web-worker the window variable is undefined, is it possible to remove reference to it ?
Following the places where window is used.
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
jryans commented
Seems like we could do something like:
var scope = this;
at the top of the module and replace those window
s with scope
. Feel free to submit a PR if that works for you!
thiagofelix commented
Just did