Skip to content

Conversation

btakita
Copy link

@btakita btakita commented Mar 1, 2023

fixes #975

// stringify the factory method for the blob worker
// eslint-disable-next-line func-name
}(this, function moduleFactory()
}(typeof globalThis !== 'undefined' ? globalThis : this, function moduleFactory()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will prefer to avoid conditional variables. Can we just use globalThis instead of this ?

Copy link
Author

@btakita btakita Mar 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Howdy @btakita and @pokoli!

Just wanted to bump this and see if it could get merged?
I could make the change to remove the ternary in favor of just globalThis if needed.

@CrunchylnMilk
Copy link

We were having the same problem and this did the job, thank you!

@dboskovic dboskovic added the v6-todo This issue should be handled in the v6 release label Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v6-todo This issue should be handled in the v6 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error Cannot set properties of undefined (setting 'Papa')

5 participants