File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -388,14 +388,18 @@ function Plugin(babel) {
388388 ) ) ;
389389 }
390390 }
391- if ( isTailCall && ( tryStack . length === 0 || finalStack . length > 0 ) ) {
391+ if ( isTailCall ) {
392392 if ( tryStack . length > 0 ) {
393393 const inTryCatch = tryStack [ tryStack . length - 1 ] ;
394- if ( path . getFunctionParent ( ) . node === inTryCatch . function . node && finalStack . length > 0 ) {
395- const inFinalizer = finalStack [ finalStack . length - 1 ] ;
396- if ( "finalizer" in inTryCatch . node && inFinalizer === inTryCatch . node . finalizer ) {
397- path . node . expressions [ 0 ] . argument . arguments . push ( t . booleanLiteral ( true ) ) ;
394+ if ( path . getFunctionParent ( ) . node === inTryCatch . function . node ) {
395+ if ( finalStack . length > 0 ) {
396+ const inFinalizer = finalStack [ finalStack . length - 1 ] ;
397+ if ( "finalizer" in inTryCatch . node && inFinalizer === inTryCatch . node . finalizer ) {
398+ path . node . expressions [ 0 ] . argument . arguments . push ( t . booleanLiteral ( true ) ) ;
399+ }
398400 }
401+ } else {
402+ path . node . expressions [ 0 ] . argument . arguments . push ( t . booleanLiteral ( true ) ) ;
399403 }
400404 } else {
401405 path . node . expressions [ 0 ] . argument . arguments . push ( t . booleanLiteral ( true ) ) ;
You can’t perform that action at this time.
0 commit comments