Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
add `keep_quoted=strict` mode #310
I made a PR for uglify-js some time back for adding keep_quoted=strict mode which prevents quoted properties from being automatically reserved (which stops unquoted properties of the same name from being mangled). This is much closer to how google-closure-compiler works; it generates less code, more completely obfuscates code and more clearly brings mistakes in code to light. If you mix quoted and unquoted for the same the property with strict-mode, the name mangling will become incorrect and the app will not work correctly, rather than silently fixing it by making any quoted props reserved. It's not as nice, but it's opt-in and for me a more desirable behavior.
Source issue: #304
@fabiosantoscode I know you said you were busy with Terser 4, but I had some time over and just thought I'd prepare a PR anyway. So it's here when you feel you have the time, I don't mind rebasing if necessary later on.
PS. I kept
I've also tested it on my large-scale work project with 700KB+ worth of source code. It work perfectly and even helped me discover some places in my code where I had gotten it wrong.