-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Edge case: converting foo === null || foo === undefined
with foo == null
is not safe
#408
Comments
This is why people hate javascript lol |
I'm not very happy to change Terser's behaviour here, but someone might hit this. I'm going to add the help wanted label. I'm looking at you @rogeriopvl. This is a good first PR for you. |
@fabiosantoscode I agree it probably isn't a good idea to change the behavior, given that basically no one writes code using This issue was really more of documentation, but also putting it out there if someone actually bothers to track usage throughout a program. |
I agree that nobody uses document.all nowadays. I started writing javascript using raw DOM, and even if I stayed that way for several lifetimes, I would have never found a use for document.all. I've changed my mind. I don't think this should warrant an increased file size for everything going through Terser checking for both null and undefined. I don't even think this is worth documenting. If people want to read about trivia from ancient times they can read something else that isn't a piece of documentation. Some things are best left forgotten. Thanks for your report though :) |
Bug report
Version: 3.17.0
Complete CLI command or
minify()
options usedterser
input:terser
output or errorExpected result
document.all
returns anHTMLAllCollection
, which per the WHATWG specification, matches== null
The text was updated successfully, but these errors were encountered: