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
mangle-props and Object.defineProperty #869
Comments
This is going to be a tough one to fix. defineProperty creates a property and takes a string. That string needs to be changed, but uglifyjs doesn't always know how to mangle the string. Another point is that the What I think of this second point is that this really shows why you really need to use --mangle-props together with a regexp. There are lots of APIs which won't take these new custom objects. Still needs a fix though. |
This is why closure compiler never changes Generally, when using We could try to do sneaky stuff like automatically adding the second argument of a |
That's pretty much what I've ended up doing. In case it helps anyone in future, I first whitelist a bunch of properties as an array. Then blacklist/remove from that array any properties that have been implemented using
Note: That particular regex works well with the JS output from the Typescript compiler. |
The following is pre-uglified:
Which is uglified using:
And produces:
The
now.year
getter/setter has becomee.c
, but the string"year"
inObject.defineProperty()
remains. Surely"year"
should become"c"
?The text was updated successfully, but these errors were encountered: