@@ -455,7 +455,7 @@ var Aff = function () {
455
455
result = util . fromRight ( step ) ;
456
456
// We need to enqueue the Release with the same interrupt
457
457
// status as the Bracket that is initiating it.
458
- attempts = new Aff ( CONS , new Aff ( RELEASE , attempt . _2 , result ) , attempts , tmp ) ;
458
+ attempts = new Aff ( CONS , new Aff ( RELEASE , attempt . _2 , step ) , attempts , tmp ) ;
459
459
// We should only coninue as long as the interrupt status has not changed or
460
460
// we are currently within a non-interruptable finalizer.
461
461
if ( interrupt === tmp || bracketCount > 0 ) {
@@ -474,16 +474,17 @@ var Aff = function () {
474
474
// since we enqueued the item, and the bracket count is 0. If the
475
475
// bracket count is non-zero then we are in a masked state so it's
476
476
// impossible to be killed.
477
+ var v = util . fromRight ( attempt . _2 ) ;
477
478
if ( interrupt && interrupt !== tmp && bracketCount === 0 ) {
478
- if ( step == null || util . isLeft ( step ) ) {
479
- step = attempt . _1 . killed ( util . fromLeft ( interrupt ) ) ( attempt . _2 ) ;
479
+ if ( step == attempt . _2 || step == null || util . isLeft ( step ) ) {
480
+ step = attempt . _1 . killed ( util . fromLeft ( interrupt ) ) ( v ) ;
480
481
} else {
481
- step = attempt . _1 . completed ( util . fromRight ( step ) ) ( attempt . _2 ) ;
482
+ step = attempt . _1 . completed ( util . fromRight ( step ) ) ( v ) ;
482
483
}
483
484
} else if ( fail ) {
484
- step = attempt . _1 . failed ( util . fromLeft ( fail ) ) ( attempt . _2 ) ;
485
+ step = attempt . _1 . failed ( util . fromLeft ( fail ) ) ( v ) ;
485
486
} else {
486
- step = attempt . _1 . completed ( util . fromRight ( step ) ) ( attempt . _2 ) ;
487
+ step = attempt . _1 . completed ( util . fromRight ( step ) ) ( v ) ;
487
488
}
488
489
fail = null ;
489
490
bracketCount ++ ;
0 commit comments