-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix util.global #1441
Fix util.global #1441
Conversation
Thank you @dcodeIO, you definitely have more experience with bundlers than I do :) |
Sorry for second-guessing btw :). If I have any bundler experience, then it is in preventing them from functioning as intended. As lost as everybody else otherwise. |
|
Hmm, more forgiving checks there could be
if
to just validate that it's at least somewhat an actual global object. |
A more general question would be what Jest is actually trying to test there. Does a Jest test suite automatically assume that it's testing in a node environment, or may it also test client code while filling in browser APIs? If the latter is possible, protobuf.js cannot decide on its own but will need some sort of flag to indicate, i.e. setting |
How about changing the order?
If something tries to pretend it's Node by having |
That looks good as well, just needs another check |
Ah, right, forgot about `null` :)
|
Folks also suggested #1444 as a possible fix to the strict |
An alternative to #1363, attempting to fix the problem at the
util.global
level as proposed in #1221 (comment).Reverts #1363 and #1440, with the latter not being needed anymore. See also: #1363 (comment)