File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -2498,7 +2498,7 @@ Compressor.prototype.compress = function(node) {
2498
2498
hit_index++;
2499
2499
}
2500
2500
branch.expression = branch.expression.transform(tt);
2501
- if (!replace_all) break;
2501
+ if (!replace_all || verify_ref ) break;
2502
2502
scan_rhs = false;
2503
2503
}
2504
2504
}
Original file line number Diff line number Diff line change @@ -10121,3 +10121,30 @@ issue_5643: {
10121
10121
}
10122
10122
expect_stdout: "42"
10123
10123
}
10124
+
10125
+ issue_5719: {
10126
+ options = {
10127
+ collapse_vars : true ,
10128
+ reduce_vars : true ,
10129
+ toplevel : true ,
10130
+ }
10131
+ input: {
10132
+ var a = 42 , b ;
10133
+ switch ( b = a ) {
10134
+ case a :
10135
+ case b :
10136
+ case a ++ :
10137
+ }
10138
+ console . log ( a === b ++ ? "PASS" : "FAIL" ) ;
10139
+ }
10140
+ expect: {
10141
+ var a = 42 , b ;
10142
+ switch ( b = a ) {
10143
+ case a :
10144
+ case b :
10145
+ case a ++ :
10146
+ }
10147
+ console . log ( a === b ++ ? "PASS" : "FAIL" ) ;
10148
+ }
10149
+ expect_stdout: "PASS"
10150
+ }
You can’t perform that action at this time.
0 commit comments