1
1
/**
2
- * Fluture bundled; version 10.3.1
2
+ * Fluture bundled; version 11.0.0
3
3
*/
4
4
5
5
var Fluture = ( function ( ) {
@@ -1177,9 +1177,9 @@ var Fluture = (function () {
1177
1177
Sequence$cancel ( ) ;
1178
1178
settled = true ;
1179
1179
cold = hot = nil ;
1180
- var error$$1 = makeError ( e , future , context ) ;
1180
+ var error = makeError ( e , future , context ) ;
1181
1181
future = never ;
1182
- rec ( error$$1 ) ;
1182
+ rec ( error ) ;
1183
1183
}
1184
1184
1185
1185
//This function serves to kickstart concurrent computations.
@@ -1366,27 +1366,27 @@ var Fluture = (function () {
1366
1366
cancel : noop
1367
1367
} ;
1368
1368
1369
- function captureActionContext ( name$$1 , fn ) {
1370
- return captureContext ( nil , 'a Future transformed with ' + name$$1 , fn ) ;
1369
+ function captureActionContext ( name , fn ) {
1370
+ return captureContext ( nil , 'a Future transformed with ' + name , fn ) ;
1371
1371
}
1372
1372
1373
1373
function nullaryActionToString ( ) {
1374
1374
return this . name + '()' ;
1375
1375
}
1376
1376
1377
- function defineNullaryAction ( name$$1 , prototype ) {
1378
- var _name = '_' + name$$1 ;
1377
+ function defineNullaryAction ( name , prototype ) {
1378
+ var _name = '_' + name ;
1379
1379
function NullaryAction ( context ) { this . context = context ; }
1380
1380
NullaryAction . prototype = Object . assign ( Object . create ( Action ) , prototype ) ;
1381
- NullaryAction . prototype . name = name$$1 ;
1381
+ NullaryAction . prototype . name = name ;
1382
1382
NullaryAction . prototype . toString = nullaryActionToString ;
1383
- Future . prototype [ name$$1 ] = function checkedNullaryTransformation ( ) {
1384
- if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name$$1 , this ) ;
1383
+ Future . prototype [ name ] = function checkedNullaryTransformation ( ) {
1384
+ if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name , this ) ;
1385
1385
return this [ _name ] ( ) ;
1386
1386
} ;
1387
1387
Future . prototype [ _name ] = function uncheckedNullaryTransformation ( ) {
1388
1388
return this . _transform ( new NullaryAction (
1389
- captureActionContext ( name$$1 , uncheckedNullaryTransformation )
1389
+ captureActionContext ( name , uncheckedNullaryTransformation )
1390
1390
) ) ;
1391
1391
} ;
1392
1392
return NullaryAction ;
@@ -1396,21 +1396,21 @@ var Fluture = (function () {
1396
1396
return this . name + '(' + showf ( this . mapper ) + ')' ;
1397
1397
}
1398
1398
1399
- function defineMapperAction ( name$$1 , prototype ) {
1400
- var _name = '_' + name$$1 ;
1399
+ function defineMapperAction ( name , prototype ) {
1400
+ var _name = '_' + name ;
1401
1401
function MapperAction ( mapper , context ) { this . mapper = mapper ; this . context = context ; }
1402
1402
MapperAction . prototype = Object . assign ( Object . create ( Action ) , prototype ) ;
1403
- MapperAction . prototype . name = name$$1 ;
1403
+ MapperAction . prototype . name = name ;
1404
1404
MapperAction . prototype . toString = mapperActionToString ;
1405
- Future . prototype [ name$$1 ] = function checkedMapperTransformation ( mapper ) {
1406
- if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name$$1 , this ) ;
1407
- if ( ! isFunction ( mapper ) ) throwInvalidArgument ( 'Future#' + name$$1 , 0 , 'be a Function' , mapper ) ;
1405
+ Future . prototype [ name ] = function checkedMapperTransformation ( mapper ) {
1406
+ if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name , this ) ;
1407
+ if ( ! isFunction ( mapper ) ) throwInvalidArgument ( 'Future#' + name , 0 , 'be a Function' , mapper ) ;
1408
1408
return this [ _name ] ( mapper ) ;
1409
1409
} ;
1410
1410
Future . prototype [ _name ] = function uncheckedMapperTransformation ( mapper ) {
1411
1411
return this . _transform ( new MapperAction (
1412
1412
mapper ,
1413
- captureActionContext ( name$$1 , uncheckedMapperTransformation )
1413
+ captureActionContext ( name , uncheckedMapperTransformation )
1414
1414
) ) ;
1415
1415
} ;
1416
1416
return MapperAction ;
@@ -1420,27 +1420,27 @@ var Fluture = (function () {
1420
1420
return this . name + '(' + showf ( this . lmapper ) + ', ' + showf ( this . rmapper ) + ')' ;
1421
1421
}
1422
1422
1423
- function defineBimapperAction ( name$$1 , prototype ) {
1424
- var _name = '_' + name$$1 ;
1423
+ function defineBimapperAction ( name , prototype ) {
1424
+ var _name = '_' + name ;
1425
1425
function BimapperAction ( lmapper , rmapper , context ) {
1426
1426
this . lmapper = lmapper ;
1427
1427
this . rmapper = rmapper ;
1428
1428
this . context = context ;
1429
1429
}
1430
1430
BimapperAction . prototype = Object . assign ( Object . create ( Action ) , prototype ) ;
1431
- BimapperAction . prototype . name = name$$1 ;
1431
+ BimapperAction . prototype . name = name ;
1432
1432
BimapperAction . prototype . toString = bimapperActionToString ;
1433
- Future . prototype [ name$$1 ] = function checkedBimapperTransformation ( lm , rm ) {
1434
- if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name$$1 , this ) ;
1435
- if ( ! isFunction ( lm ) ) throwInvalidArgument ( 'Future#' + name$$1 , 0 , 'be a Function' , lm ) ;
1436
- if ( ! isFunction ( rm ) ) throwInvalidArgument ( 'Future#' + name$$1 , 1 , 'be a Function' , rm ) ;
1433
+ Future . prototype [ name ] = function checkedBimapperTransformation ( lm , rm ) {
1434
+ if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name , this ) ;
1435
+ if ( ! isFunction ( lm ) ) throwInvalidArgument ( 'Future#' + name , 0 , 'be a Function' , lm ) ;
1436
+ if ( ! isFunction ( rm ) ) throwInvalidArgument ( 'Future#' + name , 1 , 'be a Function' , rm ) ;
1437
1437
return this [ _name ] ( lm , rm ) ;
1438
1438
} ;
1439
1439
Future . prototype [ _name ] = function uncheckedBimapperTransformation ( lmapper , rmapper ) {
1440
1440
return this . _transform ( new BimapperAction (
1441
1441
lmapper ,
1442
1442
rmapper ,
1443
- captureActionContext ( name$$1 , uncheckedBimapperTransformation )
1443
+ captureActionContext ( name , uncheckedBimapperTransformation )
1444
1444
) ) ;
1445
1445
} ;
1446
1446
return BimapperAction ;
@@ -1450,35 +1450,35 @@ var Fluture = (function () {
1450
1450
return this . name + '(' + this . other . toString ( ) + ')' ;
1451
1451
}
1452
1452
1453
- function defineOtherAction ( name$$1 , prototype ) {
1454
- var _name = '_' + name$$1 ;
1453
+ function defineOtherAction ( name , prototype ) {
1454
+ var _name = '_' + name ;
1455
1455
function OtherAction ( other , context ) { this . other = other ; this . context = context ; }
1456
1456
OtherAction . prototype = Object . assign ( Object . create ( Action ) , prototype ) ;
1457
- OtherAction . prototype . name = name$$1 ;
1457
+ OtherAction . prototype . name = name ;
1458
1458
OtherAction . prototype . toString = otherActionToString ;
1459
- Future . prototype [ name$$1 ] = function checkedOtherTransformation ( other ) {
1460
- if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name$$1 , this ) ;
1461
- if ( ! isFuture ( other ) ) throwInvalidFuture ( 'Future#' + name$$1 , 0 , other ) ;
1459
+ Future . prototype [ name ] = function checkedOtherTransformation ( other ) {
1460
+ if ( ! isFuture ( this ) ) throwInvalidContext ( 'Future#' + name , this ) ;
1461
+ if ( ! isFuture ( other ) ) throwInvalidFuture ( 'Future#' + name , 0 , other ) ;
1462
1462
return this [ _name ] ( other ) ;
1463
1463
} ;
1464
1464
Future . prototype [ _name ] = function uncheckedOtherTransformation ( other ) {
1465
1465
return this . _transform ( new OtherAction (
1466
1466
other ,
1467
- captureActionContext ( name$$1 , uncheckedOtherTransformation )
1467
+ captureActionContext ( name , uncheckedOtherTransformation )
1468
1468
) ) ;
1469
1469
} ;
1470
1470
return OtherAction ;
1471
1471
}
1472
1472
1473
- function defineParallelAction ( name$$1 , rec , rej , res , prototype ) {
1474
- var ParallelAction = defineOtherAction ( name$$1 , prototype ) ;
1473
+ function defineParallelAction ( name , rec , rej , res , prototype ) {
1474
+ var ParallelAction = defineOtherAction ( name , prototype ) ;
1475
1475
ParallelAction . prototype . run = function ParallelAction$run ( early ) {
1476
1476
var eager = new Eager ( this . other ) ;
1477
1477
var action = new ParallelAction ( eager ) ;
1478
1478
function ParallelAction$early ( m ) { early ( m , action ) ; }
1479
1479
action . context = captureContext (
1480
1480
this . context ,
1481
- name$$1 + ' triggering a parallel Future' ,
1481
+ name + ' triggering a parallel Future' ,
1482
1482
ParallelAction$run
1483
1483
) ;
1484
1484
action . cancel = eager . _interpret (
@@ -2620,21 +2620,7 @@ var Fluture = (function () {
2620
2620
cont ( value ) ;
2621
2621
}
2622
2622
2623
- function Hook$reject ( x ) {
2624
- rej ( x ) ;
2625
- }
2626
-
2627
- function Hook$consumptionException ( report ) {
2628
- var rec_ = rec ;
2629
- cont = noop ;
2630
- rej = noop ;
2631
- rec = noop ;
2632
- Hook$dispose ( ) ;
2633
- rec_ ( report ) ;
2634
- }
2635
-
2636
2623
function Hook$dispose ( ) {
2637
- context = captureContext ( context , 'hook consuming a resource' , Hook$dispose ) ;
2638
2624
var disposal ;
2639
2625
try {
2640
2626
disposal = _dispose ( resource ) ;
@@ -2644,7 +2630,7 @@ var Fluture = (function () {
2644
2630
if ( ! isFuture ( disposal ) ) {
2645
2631
return rec ( makeError ( invalidDisposal ( disposal , _dispose , resource ) , _this , context ) ) ;
2646
2632
}
2647
- disposal . _interpret ( rec , Hook$reject , Hook$done ) ;
2633
+ disposal . _interpret ( Hook$disposalCrashed , Hook$disposalRejected , Hook$done ) ;
2648
2634
cancel = Hook$cancelDisposal ;
2649
2635
}
2650
2636
@@ -2656,17 +2642,32 @@ var Fluture = (function () {
2656
2642
2657
2643
function Hook$cancelDisposal ( ) {
2658
2644
cont = noop ;
2659
- rec = noop ;
2660
- rej = noop ;
2645
+ }
2646
+
2647
+ function Hook$disposalCrashed ( x ) {
2648
+ rec ( makeError ( x , _this , context ) ) ;
2649
+ }
2650
+
2651
+ function Hook$disposalRejected ( x ) {
2652
+ rec ( makeError ( new Error ( 'The disposal Future rejected with ' + sanctuaryShow ( x ) ) , _this , context ) ) ;
2653
+ }
2654
+
2655
+ function Hook$consumptionException ( x ) {
2656
+ context = captureContext ( context , 'resource consumption crashing' , Hook$dispose ) ;
2657
+ cont = rec ;
2658
+ value = x ;
2659
+ Hook$dispose ( ) ;
2661
2660
}
2662
2661
2663
2662
function Hook$consumptionRejected ( x ) {
2663
+ context = captureContext ( context , 'resource consumption failing' , Hook$consumptionRejected ) ;
2664
2664
cont = rej ;
2665
2665
value = x ;
2666
2666
Hook$dispose ( ) ;
2667
2667
}
2668
2668
2669
2669
function Hook$consumptionResolved ( x ) {
2670
+ context = captureContext ( context , 'resource consumption' , Hook$consumptionResolved ) ;
2670
2671
cont = res ;
2671
2672
value = x ;
2672
2673
Hook$dispose ( ) ;
@@ -2696,10 +2697,13 @@ var Fluture = (function () {
2696
2697
) ;
2697
2698
}
2698
2699
2699
- var cancelAcquire = _acquire . _interpret ( rec , Hook$reject , Hook$consume ) ;
2700
+ var cancelAcquire = _acquire . _interpret ( rec , rej , Hook$consume ) ;
2700
2701
cancel = cancel || cancelAcquire ;
2701
2702
2702
- return function Hook$fork$cancel ( ) { cancel ( ) ; } ;
2703
+ return function Hook$fork$cancel ( ) {
2704
+ rec = raise ;
2705
+ cancel ( ) ;
2706
+ } ;
2703
2707
2704
2708
} ;
2705
2709
0 commit comments