Logic error when using spread operator
See original GitHub issueMinimal working example that will help to reproduce issue
const demo = { active: true, name: 'demo' }
console.log({
active: false,
...demo
})
Expected Behavior
Output: { active: true, name: ‘demo’ }
Current Behavior
Output: { active: false, name: ‘demo’ }
Your Environment
- 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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Spread syntax (...) - JavaScript - MDN Web Docs - Mozilla
Spread syntax can be used when all elements from an object or array need to be included in a new array or object,...
Read more >Explain spread operator in ES6 with an Example
The spread operator eventually takes any iterable object such as an array or any other iterable object and expands the values of that...
Read more >Using ES6 spread operator on an object that is returned from ...
It's a syntax error. You can only use spread in the places where spread is defined (that's part of why it's notation/syntax, not...
Read more >Conditional Object Properties Using Spread in JavaScript
The line 2 expression omits a name from being applied if the condition fails. This works because the spread operator ignores values without...
Read more >A Simple Guide to Destructuring and ES6 Spread Operator
The Spread Operator has more than one function. In a sense, it is overloaded. It can also be used as rest operator in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems I fixed it. PR will be ready in 30 minutes. After the fix, all object members previous to
spread element
will be ignored.Released