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
{{ message }}
Repository navigation
Comma operator in constructor can cause "out of order" property initialization #937
It seems that under some circumstances where property initialization in a constructor is done with chained comma operators (a common result of minified code), the obfuscator can cause out of order initialization, where later initializations in the chain don't have access to previous initializations.
Minimal working example that will help to reproduce issue
Here, the obj object, has the fields undefined, despite coming after the initialization of those properties. Unexpectedly, in the GoodClass, the parameters are set correctly. The only difference between the classes is that the GoodClass uses param2: param2, rather than param2: this.param2 when initializing obj. I'm not sure what's going on internally that makes this work propertly, but it might be helpful.
Steps to Reproduce
You can use the above setup. I've also made a proof of concept repo, where you can demonstrate the bug with:
Activity
sanex3339 commentedon Jun 13, 2021
Can reproduce it, will check it today.
As a temporal solution set
transformObjectKeys: falsesanex3339 commentedon Jun 13, 2021
PR will be ready in 20 minutes. Will release it in an hour or so.
sanex3339 commentedon Jun 13, 2021
PR: #938
sanex3339 commentedon Jun 13, 2021
Released as
2.15.2