@@ -35,8 +35,8 @@ module.exports = function (options) {
35
35
this . noCache ( ) ;
36
36
var files = [ ] ;
37
37
fs . readdir ( options . uploadDir ( ) , _ . bind ( function ( err , list ) {
38
- async . each ( list , function ( name , cb ) {
39
- fs . stat ( options . uploadDir ( ) + '/' + name , function ( err , stats ) {
38
+ async . each ( list , _ . bind ( function ( name , cb ) {
39
+ fs . stat ( options . uploadDir ( ) + '/' + name , _ . bind ( function ( err , stats ) {
40
40
if ( ! err ) {
41
41
if ( stats . isFile ( ) ) {
42
42
fileInfo = new FileInfo ( {
@@ -51,8 +51,8 @@ module.exports = function (options) {
51
51
}
52
52
}
53
53
cb ( err ) ;
54
- } ) ;
55
- } ,
54
+ } , this ) ) ;
55
+ } , this ) ,
56
56
function ( err ) {
57
57
if ( err ) console . log ( err ) ;
58
58
this . callback ( { files : files } ) ;
@@ -70,15 +70,15 @@ module.exports = function (options) {
70
70
redirect ,
71
71
finish = _ . bind ( function ( ) {
72
72
if ( ! -- counter ) {
73
- async . each ( files , function ( fileInfo , cb ) {
74
- this . initUrls ( fileInfo , function ( err ) {
73
+ async . each ( files , _ . bind ( function ( fileInfo , cb ) {
74
+ this . initUrls ( fileInfo , _ . bind ( function ( err ) {
75
75
this . emit ( 'end' , fileInfo ) ;
76
76
cb ( err ) ;
77
- } ) ;
78
- } ,
79
- function ( err ) {
77
+ } , this ) ) ;
78
+ } , this ) ,
79
+ _ . bind ( function ( err ) {
80
80
this . callback ( { files : files } , redirect ) ;
81
- } ) ;
81
+ } , this ) ) ;
82
82
}
83
83
} , this ) ;
84
84
0 commit comments