<!-- Love javascript-obfuscator? Please consider supporting our collective: 👉 https://opencollective.com/javascript-obfuscator/donate --> ## Minimal working example that will help to reproduce issue <!--- Include code --> ``` const demo = { active: true, name: 'demo' } console.log({ active: false, ...demo }) ``` ## Expected Behavior <!--- Tell us what should happen --> Output: { active: true, name: 'demo' } ## Current Behavior <!--- Tell us what happens instead of the expected behavior --> Output: { active: false, name: 'demo' } ## Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * Obfuscator version used: 2.6.3 * Node version used: v12.13.1 ## Code After Obfuscation: ``` const _0x41674a={..._0x5b345c}; _0x41674a[_0x22a0ec('0x17')]=![], console['log'](_0x41674a);} ``` Clearly, the order of assignment is wrong.
Activity
[-]Obfuscate code contains spread operator may cause logical error [/-][+]Logic error when using spread operator[/+]sanex3339 commentedon Nov 3, 2020
Hi. What options did you use?
sanex3339 commentedon Nov 3, 2020
This bug reproduced with
transformObjectKeysoption is enabled.sanex3339 commentedon Nov 3, 2020
Seems I fixed it. PR will be ready in 30 minutes.
After the fix, all object members previous to
spread elementwill be ignored.Added ignoring of all object members previous to `SpreadElement` when…
sanex3339 commentedon Nov 3, 2020
That's sad that this bug has existed for so long.
sanex3339 commentedon Nov 3, 2020
Will be released as
2.6.4later todaysanex3339 commentedon Nov 3, 2020
Released