@@ -357,7 +357,15 @@ var Aff = function () {
357
357
if ( bhead === null ) {
358
358
attempts = new Aff ( CONS , step , attempts , interrupt ) ;
359
359
} else {
360
- attempts = new Aff ( CONS , step , new Aff ( CONS , new Aff ( RESUME , bhead , btail ) , attempts , interrupt ) , interrupt ) ;
360
+ attempts = new Aff ( CONS ,
361
+ step ,
362
+ new Aff ( CONS ,
363
+ new Aff ( RESUME ,
364
+ bhead ,
365
+ btail ) ,
366
+ attempts ,
367
+ interrupt ) ,
368
+ interrupt ) ;
361
369
}
362
370
bhead = null ;
363
371
btail = null ;
@@ -370,9 +378,21 @@ var Aff = function () {
370
378
case BRACKET :
371
379
bracketCount ++ ;
372
380
if ( bhead === null ) {
373
- attempts = new Aff ( CONS , step , attempts , interrupt ) ;
381
+ attempts = new Aff ( CONS ,
382
+ step ,
383
+ attempts ,
384
+ interrupt ) ;
374
385
} else {
375
- attempts = new Aff ( CONS , step , new Aff ( CONS , new Aff ( RESUME , bhead , btail ) , attempts , interrupt ) , interrupt ) ;
386
+ attempts =
387
+ new Aff ( CONS ,
388
+ step ,
389
+ new Aff ( CONS ,
390
+ new Aff ( RESUME ,
391
+ bhead ,
392
+ btail ) ,
393
+ attempts ,
394
+ interrupt ) ,
395
+ interrupt ) ;
376
396
}
377
397
bhead = null ;
378
398
btail = null ;
@@ -455,7 +475,12 @@ var Aff = function () {
455
475
result = util . fromRight ( step ) ;
456
476
// We need to enqueue the Release with the same interrupt
457
477
// status as the Bracket that is initiating it.
458
- attempts = new Aff ( CONS , new Aff ( RELEASE , attempt . _2 , result ) , attempts , tmp ) ;
478
+ attempts = new Aff ( CONS ,
479
+ new Aff ( RELEASE ,
480
+ attempt . _2 ,
481
+ result ) ,
482
+ attempts ,
483
+ tmp ) ;
459
484
// We should only coninue as long as the interrupt status has not changed or
460
485
// we are currently within a non-interruptable finalizer.
461
486
if ( interrupt === tmp || bracketCount > 0 ) {
@@ -468,13 +493,19 @@ var Aff = function () {
468
493
// Enqueue the appropriate handler. We increase the bracket count
469
494
// because it should not be cancelled.
470
495
case RELEASE :
471
- attempts = new Aff ( CONS , new Aff ( FINALIZED , step , fail ) , attempts , interrupt ) ;
496
+ attempts = new Aff ( CONS ,
497
+ new Aff ( FINALIZED ,
498
+ step ,
499
+ fail ) ,
500
+ attempts ,
501
+ interrupt ) ;
472
502
status = CONTINUE ;
473
503
// It has only been killed if the interrupt status has changed
474
504
// since we enqueued the item, and the bracket count is 0. If the
475
505
// bracket count is non-zero then we are in a masked state so it's
476
506
// impossible to be killed.
477
507
if ( interrupt && interrupt !== tmp && bracketCount === 0 ) {
508
+ console . log ( attempt )
478
509
step = attempt . _1 . killed ( util . fromLeft ( interrupt ) ) ( attempt . _2 ) ;
479
510
} else if ( fail ) {
480
511
step = attempt . _1 . failed ( util . fromLeft ( fail ) ) ( attempt . _2 ) ;
0 commit comments