You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many function call happen through "object pattern" parameters in modern js and google closure does no constant propagation through them nor does it have "re-write to normal params" kind of pass.
The text was updated successfully, but these errors were encountered:
Thank you for your report! We'll attempt to improve this when we can.
You could experiment with setting --language_out=ECMASCRIPT5 to see if that gives you better results. It should fix this very specific issue but comes with transpilation of other newer JS features so may not work in your case.
Thank you, i didn't expect this result! We work with --language_out=UNSTABLE currently and I'm not sure if we can feasibly do es5 output.
ObjectPattern = ObjectExpression declarations or assignments are very frequent in modern js. They occur in jsx transformed js or whenever object pattern parameters are preferred for variable name clarity.
Actually the situation is a bit worse than I initially wrote:
I think there are multiple low hanging fruits here.
Remove unused object expression keys: At an early pass, remove the keys of the object expression which do not match, and move the corresponding value expression out of the object expression, right before the current declaration / assignment.
For ObjectPattern = ObjectExpression assignments, simply convert them to a sequence of regular assignments.
Google closure struggles with constant propagation through destructing assignments, which, unfortunately happens very frequently in modern js code.
google-closure-compiler --js a.js -O ADVANCED
outputsMany function call happen through "object pattern" parameters in modern js and google closure does no constant propagation through them nor does it have "re-write to normal params" kind of pass.
The text was updated successfully, but these errors were encountered: