File tree Expand file tree Collapse file tree 2 files changed +54
-2
lines changed Expand file tree Collapse file tree 2 files changed +54
-2
lines changed Original file line number Diff line number Diff line change @@ -5281,7 +5281,7 @@ merge(Compressor.prototype, {
5281
5281
if (member(def.scope, scopes)) return true;
5282
5282
if (scope && !def.redefined()) {
5283
5283
var scope_def = scope.find_variable(node.name);
5284
- if (def.undeclared ? ! scope_def : scope_def === def) {
5284
+ if (scope_def ? scope_def === def : def.undeclared ) {
5285
5285
result = "f";
5286
5286
return true;
5287
5287
}
@@ -7637,7 +7637,6 @@ merge(Compressor.prototype, {
7637
7637
}).init_vars(node),
7638
7638
}));
7639
7639
exprs = [ node ];
7640
-
7641
7640
}
7642
7641
if (values) exprs.push(make_node(AST_Call, this, {
7643
7642
expression: make_node(AST_Arrow, this, {
Original file line number Diff line number Diff line change @@ -1590,3 +1590,56 @@ issue_4951_2: {
1590
1590
expect_stdout: "PASS"
1591
1591
node_version: ">=14.6"
1592
1592
}
1593
+
1594
+ issue_4962_1: {
1595
+ options = {
1596
+ ie8 : true ,
1597
+ inline : true ,
1598
+ reduce_vars : true ,
1599
+ unused : true ,
1600
+ }
1601
+ input: {
1602
+ ( function ( ) {
1603
+ function f ( ) {
1604
+ while ( console . log ( typeof g ) ) ;
1605
+ }
1606
+ class A {
1607
+ static p = f ( ) ;
1608
+ }
1609
+ } ) ( function g ( ) { } ) ;
1610
+ }
1611
+ expect: {
1612
+ ( function g ( ) { } ) ,
1613
+ void function ( ) {
1614
+ while ( console . log ( typeof g ) ) ;
1615
+ } ( ) ;
1616
+ }
1617
+ expect_stdout: "undefined"
1618
+ node_version: ">=12"
1619
+ }
1620
+
1621
+ issue_4962_2: {
1622
+ options = {
1623
+ ie8 : true ,
1624
+ inline : true ,
1625
+ reduce_vars : true ,
1626
+ unused : true ,
1627
+ }
1628
+ input: {
1629
+ console . log ( function f ( ) { } ( function g ( ) {
1630
+ function h ( ) {
1631
+ f ;
1632
+ }
1633
+ class A {
1634
+ static p = h ( ) ;
1635
+ }
1636
+ } , typeof g ) ) ;
1637
+ }
1638
+ expect: {
1639
+ console . log ( function f ( ) { } ( function g ( ) {
1640
+ f ;
1641
+ } ) ) ;
1642
+ }
1643
+ expect_stdout: "undefined"
1644
+ node_version: ">=12"
1645
+ }
You can’t perform that action at this time.
0 commit comments