Ticket #2876 (new defect)
ShrinkSafe v0.1.0 will break javascript with multiple var inside if-else
| Reported by: | guest | Owned by: | alex |
|---|---|---|---|
| Priority: | normal | Milestone: | future |
| Component: | ShrinkSafe | Version: | |
| Severity: | normal | Keywords: | multiple variable definitions |
| Cc: |
Description (last modified by dylan) (diff)
shrinksafe (the online version as of april 28,2007 v0.1.0) will break a script if it's got multiple variable definitions for the same variable within an if-else:
function test(bVariable) {
if (bVariable) {
var aVariable='ok';
}else{
var aVariable='not ok';
}
alert(aVariable);
}
in the example above, shrinksafe will not recognize that 'aVariable' is the same variable and will assign two different variable names:
function test(_1){if(_1){var _2="ok";}else{var _3="not ok";}alert(_3);}
Change History
Note: See
TracTickets for help on using
tickets.