-
Notifications
You must be signed in to change notification settings - Fork 146
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
(0, fn)(...args) type of calls #6
Comments
but in other cases it's not guaranteed to be safe Maybe the function can be analyzed, or I'll just add an option to use unsafe transforms |
Yeah that's what it does but do you really see any possible issue with not removing context for such function calls? I mean it could be useful in super specific and advanced JS cases, but assuming Webpack usually works with ES/TS codebases, it shouldn't really be the issue. That's why I've asked about cases when it does that as I'm almost sure that it doesn't do this particular transform because of specific of the source code and in raw ES/TS source the calls would be made with |
Seems like webpack does this only in case |
Just checked: TS and webpack do it for all functions |
I came across another tool today that seemed to handle this pretty well: Digging through the code a little lead me to this:
|
good idea to do it like this 👍🏻 |
Is there any particular reason to not replace calls like
(0, fn)(...args)
to justfn(...args)
? Also, would be great to know in which cases webpack does this kind of transformation if anyone knows...The text was updated successfully, but these errors were encountered: