1- var initializeFuture ;
2- var __hasProp = Object . prototype . hasOwnProperty , __extends = function ( child , parent ) {
3- for ( var key in parent ) { if ( __hasProp . call ( parent , key ) ) child [ key ] = parent [ key ] ; }
4- function ctor ( ) { this . constructor = child ; }
5- ctor . prototype = parent . prototype ;
6- child . prototype = new ctor ;
7- child . __super__ = parent . prototype ;
8- return child ;
9- } ;
1+ var initializeFuture ,
2+ __hasProp = { } . hasOwnProperty ,
3+ __extends = function ( child , parent ) { for ( var key in parent ) { if ( __hasProp . call ( parent , key ) ) child [ key ] = parent [ key ] ; } function ctor ( ) { this . constructor = child ; } ctor . prototype = parent . prototype ; child . prototype = new ctor ( ) ; child . __super__ = parent . prototype ; return child ; } ;
4+
105module . exports = function ( context ) {
116 var Future ;
127 if ( 'function' === typeof context ) {
138 if ( context . name ) {
14- return Future = ( function ( ) {
15- __extends ( Future , context ) ;
9+ return Future = ( function ( _super ) {
10+
11+ __extends ( Future , _super ) ;
12+
1613 Future . queue || ( Future . queue = [ ] ) ;
14+
1715 function Future ( ) {
1816 this . queue = [ ] ;
1917 Future . __super__ . constructor . apply ( this , arguments ) ;
2018 }
19+
2120 initializeFuture . call ( Future ) ;
21+
2222 return Future ;
23- } ) ( ) ;
23+
24+ } ) ( context ) ;
2425 } else {
2526 context . isFuture = true ;
2627 return context ;
2728 }
2829 }
2930} ;
31+
3032initializeFuture = ( function ( ) {
3133 var Pipeline , andThen , filter , isFuture , method , methods , next , originalMethods , replaceMethods , slice , _ref ;
3234 _ref = require ( 'underscore' ) , filter = _ref . filter , methods = _ref . methods ;
@@ -77,10 +79,10 @@ initializeFuture = (function() {
7779 return this [ methodName ] . isFuture ;
7880 } ;
7981 replaceMethods = function ( ) {
80- var methodName , _i , _len , _ref2 ;
81- _ref2 = filter ( methods ( this ) , isFuture . bind ( this ) ) ;
82- for ( _i = 0 , _len = _ref2 . length ; _i < _len ; _i ++ ) {
83- methodName = _ref2 [ _i ] ;
82+ var methodName , _i , _len , _ref1 ;
83+ _ref1 = filter ( methods ( this ) , isFuture . bind ( this ) ) ;
84+ for ( _i = 0 , _len = _ref1 . length ; _i < _len ; _i ++ ) {
85+ methodName = _ref1 [ _i ] ;
8486 this [ methodName ] = method ( this , methodName ) ;
8587 }
8688 return this . then = andThen ;
@@ -89,4 +91,4 @@ initializeFuture = (function() {
8991 replaceMethods . call ( this ) ;
9092 return replaceMethods . call ( this . prototype ) ;
9193 } ;
92- } ) ( ) ;
94+ } ) ( ) ;
0 commit comments