File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3416,13 +3416,17 @@ Compressor.prototype.compress = function(node) {
34163416 if (def.references.length - def.replaced == referenced) return true;
34173417 if (!def.fixed) return false;
34183418 if (!lhs.fixed) return false;
3419+ var assigns = lhs.fixed.assigns;
34193420 var matched = 0;
34203421 if (!all(def.references, function(ref, index) {
34213422 var fixed = ref.fixed;
34223423 if (!fixed) return false;
34233424 if (fixed.to_binary || fixed.to_prefix) return false;
3424- if (fixed === lhs.fixed) matched++;
3425- return true;
3425+ if (fixed === lhs.fixed) {
3426+ matched++;
3427+ return true;
3428+ }
3429+ return assigns && fixed.assigns && assigns[0] !== fixed.assigns[0];
34263430 })) return false;
34273431 if (matched != referenced) return false;
34283432 verify_ref = true;
Original file line number Diff line number Diff line change @@ -10098,3 +10098,26 @@ issue_5638_4: {
1009810098 }
1009910099 expect_stdout: "foo 42"
1010010100}
10101+
10102+ issue_5643: {
10103+ options = {
10104+ collapse_vars : true ,
10105+ reduce_vars : true ,
10106+ toplevel : true ,
10107+ }
10108+ input: {
10109+ var a = 3 , b ;
10110+ a *= 7 ;
10111+ b = ! ! this ;
10112+ console || console . log ( b ) ;
10113+ console . log ( a * ++ b ) ;
10114+ }
10115+ expect: {
10116+ var a = 3 , b ;
10117+ a *= 7 ;
10118+ b = ! ! this ;
10119+ console || console . log ( b ) ;
10120+ console . log ( a * ++ b ) ;
10121+ }
10122+ expect_stdout: "42"
10123+ }
You can’t perform that action at this time.
0 commit comments