File tree 2 files changed +36
-1
lines changed
2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -3828,7 +3828,8 @@ Compressor.prototype.compress = function(node) {
3828
3828
var changed = false;
3829
3829
var index = statements.length - 1;
3830
3830
if (in_lambda && index >= 0) {
3831
- var inlined = statements[index].try_inline(compressor, block_scope);
3831
+ var no_return = in_try && in_try.bfinally && in_async_generator(scope);
3832
+ var inlined = statements[index].try_inline(compressor, block_scope, no_return);
3832
3833
if (inlined) {
3833
3834
statements[index--] = inlined;
3834
3835
changed = true;
Original file line number Diff line number Diff line change @@ -1701,3 +1701,37 @@ issue_5526: {
1701
1701
]
1702
1702
node_version: ">=10"
1703
1703
}
1704
+
1705
+ issue_5576: {
1706
+ options = {
1707
+ inline : true ,
1708
+ }
1709
+ input: {
1710
+ ( async function * ( ) {
1711
+ try {
1712
+ ( function ( ) {
1713
+ while ( console . log ( "foo" ) ) ;
1714
+ } ) ( ) ;
1715
+ } finally {
1716
+ console . log ( "bar" ) ;
1717
+ }
1718
+ } ) ( ) . next ( ) ;
1719
+ console . log ( "baz" ) ;
1720
+ }
1721
+ expect: {
1722
+ ( async function * ( ) {
1723
+ try {
1724
+ while ( console . log ( "foo" ) ) ;
1725
+ } finally {
1726
+ console . log ( "bar" ) ;
1727
+ }
1728
+ } ) ( ) . next ( ) ;
1729
+ console . log ( "baz" ) ;
1730
+ }
1731
+ expect_stdout: [
1732
+ "foo" ,
1733
+ "bar" ,
1734
+ "baz" ,
1735
+ ]
1736
+ node_version: ">=10"
1737
+ }
You can’t perform that action at this time.
0 commit comments