Reduce Obfuscated Code Size
Is your feature request related to a problem? Please describe.
Everyone likes smaller code!
This suggestion is base don the assumption that the functions I see scattered throughout the obfuscated code are "dead code noise", e.g. function(g,a){return g*a;}.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
There are a lot of functions and they take up more space that necessary.
Describe the solution you'd like
Replace function(g,a){return ga;} and similar with with (g,a) => ga; Or perhaps randomly vary between the two.
Should perhaps be a config option, e.g. "Arrow obfuscation OK";
Describe alternatives you've considered
None
Additional context Add any other context or screenshots about the feature request here.
How about implement like here? If arrow functions are present in code - obfuscator also will use them.
Not sure how this addresses my comment, unless you are saying that obfuscator mirrors the function style of the code it is flattening or dead ending when defining other functions.
In this case, I should work to use more arrow functions in my source and less regular functions.
On Fri, Dec 4, 2020 at 12:26 PM Manzhula David [email protected] wrote:
How about this https://github.com/javascript-obfuscator/javascript-obfuscator#kind-of-variables ? If arrow functions are present in code - obfuscator also will use them.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/javascript-obfuscator/javascript-obfuscator/issues/830#issuecomment-739000962, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF2US2DP2O2GPPFC7ZK743STFAVPANCNFSM4UMRKJSQ .
@anywhichway, no no, I just offered idea for this feature. Sory if I confused you
Hmm. Some mechanism that detects if obfuscated code uses arrow functions and after that appends them - would be nice. Anyway if I do this feature it will transform only functions appended by the obfuscator itself.
exactly what I was looking for!
On Saturday, December 5, 2020, Timofey Kachalov [email protected] wrote:
Hmm. Some mechanism that detects if obfuscated code uses arrow functions and after that appends them - would be nice. Anyway if I do this feature it will transform only functions appended by the obfuscator itself.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/javascript-obfuscator/javascript-obfuscator/issues/830#issuecomment-739250520, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF2US3PP7C2UDDZQCNZVJDSTIXZ7ANCNFSM4UMRKJSQ .
If you use this somewhere in code arrow function can just destoy all. I mean:
function kruzya() {const self = this;this.gay = true; return self;} // work fine
const kruzya = () => this.gay = true, this; // unexpected this
Or if I miss what exact mean author of this issue :thinking:
@BlackYuzia, as stated in this comment, it will transform only functions appended by the obfuscator itself.
Other idea: add option kinda "supportModernJavascrypt". It will be useful for destructuring like in #720 and also may be useful for future interesting syntax constructions