prefer to use globalThis & fallback to this#976
Conversation
| // stringify the factory method for the blob worker | ||
| // eslint-disable-next-line func-name | ||
| }(this, function moduleFactory() | ||
| }(typeof globalThis !== 'undefined' ? globalThis : this, function moduleFactory() |
There was a problem hiding this comment.
I will prefer to avoid conditional variables. Can we just use globalThis instead of this ?
There was a problem hiding this comment.
Sure. I added the conditional for backward compatability but according to the globalThis docs, all modern browsers in the current version support globalThis.
It looks like internet explorer does not support globalThis without a polyfill though.
https://caniuse.com/?search=globalThis
So if you are willing to drop IE without the polyfill support, then using only globalThis would probably work.
There was a problem hiding this comment.
I think we can drop IE without the polyfill (if anyone needs the IE support can implement the polyfill by themselves).
Could you please update the PR so I can merge them? Thanks
|
We were having the same problem and this did the job, thank you! |
fixes #975