-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
simplify doesn't work #860
Description
Hello :
when I obfuscate this :
if (a==0) { for (i=0;i<5;i++) if (b[i]==0) alert(1); } else alert(2);
with the default option preset,
I have the result :
if(a==0x0)for(i=0x0;i<0x5;i++)if(b[i]==0x0)alert(0x1);else alert(0x2);
So the "else" is now on the condition b[i]==0, no more for the condition a==0 and the script is not the same (with my code, if a ==0, I could have 0 alert if all b are != 0. With your code, I have 5 alerts)
If I unchecked the "Simplify" = no problem = the {} stay
If I write this :
if (a==0) { for (i=0;i<5;i++) { if (b[i]==0) alert(1); } } else alert(2);
I have the result
if(a==0x0)for(i=0x0;i<0x5;i++){if(b[i]==0x0)alert(0x1);}else alert(0x2);
so it works because the {} for the "for", useless, is not simplify (bug number 2).
Another example for bug n°2, if I write :
for(i=0;i<5;i++) {if (b[i]==0) alert(1);} alert(2);
I have the result :
for(i=0x0;i<0x5;i++){if(b[i]==0x0)alert(0x1);}alert(0x2);
the {} is still there.
The second bug is not really a bug (could be better but not a problem for me)
The first bug changes the meaning of javascript so I think it is a big problem
Best regards
Mahab