File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -3536,7 +3536,7 @@ Compressor.prototype.compress = function(node) {
3536
3536
var declare_only, jump, merge_jump;
3537
3537
var in_iife = in_lambda && parent && parent.TYPE == "Call" && parent.expression === self;
3538
3538
var chain_if_returns = in_lambda && compressor.option("conditionals") && compressor.option("sequences");
3539
- var drop_return_void = !(in_try && in_try.bfinally && in_async_generator(in_lambda ));
3539
+ var drop_return_void = !(in_try && in_try.bfinally && in_async_generator(scope ));
3540
3540
var multiple_if_returns = has_multiple_if_returns(statements);
3541
3541
for (var i = statements.length; --i >= 0;) {
3542
3542
var stat = statements[i];
Original file line number Diff line number Diff line change @@ -2039,3 +2039,40 @@ issue_5707: {
2039
2039
expect_stdout: "PASS"
2040
2040
node_version: ">=6"
2041
2041
}
2042
+
2043
+ issue_5710: {
2044
+ options = {
2045
+ conditionals : true ,
2046
+ if_return : true ,
2047
+ }
2048
+ input: {
2049
+ ( async function * ( ) {
2050
+ try {
2051
+ switch ( 42 ) {
2052
+ case 42 :
2053
+ {
2054
+ if ( console . log ( "PASS" ) )
2055
+ return ;
2056
+ return null ;
2057
+ }
2058
+ break ;
2059
+ }
2060
+ } finally { }
2061
+ } ) ( ) . next ( ) ;
2062
+ }
2063
+ expect: {
2064
+ ( async function * ( ) {
2065
+ try {
2066
+ switch ( 42 ) {
2067
+ case 42 :
2068
+ if ( console . log ( "PASS" ) )
2069
+ return ;
2070
+ return null ;
2071
+ break ;
2072
+ }
2073
+ } finally { }
2074
+ } ) ( ) . next ( ) ;
2075
+ }
2076
+ expect_stdout: "PASS"
2077
+ node_version: ">=10"
2078
+ }
You can’t perform that action at this time.
0 commit comments