File tree 2 files changed +36
-4
lines changed
2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -601,10 +601,6 @@ Compressor.prototype.compress = function(node) {
601
601
fn.enclosed.forEach(function(d) {
602
602
if (fn.variables.get(d.name) === d) return;
603
603
if (safe_to_read(tw, d)) return;
604
- d.single_use = false;
605
- var fixed = d.fixed;
606
- if (typeof fixed == "function") fixed = fixed();
607
- if (fixed instanceof AST_Lambda && fixed.safe_ids !== undefined) return;
608
604
d.fixed = false;
609
605
});
610
606
}
Original file line number Diff line number Diff line change @@ -1715,3 +1715,39 @@ issue_5856: {
1715
1715
}
1716
1716
expect_stdout: "PASS"
1717
1717
}
1718
+
1719
+ issue_5917: {
1720
+ options = {
1721
+ pure_getters : "strict" ,
1722
+ reduce_vars : true ,
1723
+ side_effects : true ,
1724
+ toplevel : true ,
1725
+ }
1726
+ input: {
1727
+ var a ;
1728
+ console || ( a = function ( ) { } ) ( f ) ;
1729
+ function f ( ) {
1730
+ a . p ;
1731
+ }
1732
+ try {
1733
+ f ( ) ;
1734
+ console . log ( "FAIL" ) ;
1735
+ } catch ( e ) {
1736
+ console . log ( "PASS" ) ;
1737
+ }
1738
+ }
1739
+ expect: {
1740
+ var a ;
1741
+ console || ( a = function ( ) { } ) ( f ) ;
1742
+ function f ( ) {
1743
+ a . p ;
1744
+ }
1745
+ try {
1746
+ f ( ) ;
1747
+ console . log ( "FAIL" ) ;
1748
+ } catch ( e ) {
1749
+ console . log ( "PASS" ) ;
1750
+ }
1751
+ }
1752
+ expect_stdout: "PASS"
1753
+ }
You can’t perform that action at this time.
0 commit comments