@@ -43,62 +43,62 @@ Walker.prototype.filterDir = function(fn) {
4343/**
4444 * Process a file or directory.
4545 */
46- Walker . prototype . go = function ( target ) {
46+ Walker . prototype . go = function ( entry ) {
4747 var that = this
4848 this . _pending ++
4949
50- fs . lstat ( target , function ( er , stat ) {
50+ fs . lstat ( entry , function ( er , stat ) {
5151 if ( er ) {
52- that . emit ( 'error' , er , target , stat )
52+ that . emit ( 'error' , er , entry , stat )
5353 that . doneOne ( )
5454 return
5555 }
5656
5757 if ( stat . isDirectory ( ) ) {
58- if ( ! that . _filterDir ( target , stat ) ) {
58+ if ( ! that . _filterDir ( entry , stat ) ) {
5959 that . doneOne ( )
6060 } else {
61- fs . readdir ( target , function ( er , files ) {
61+ fs . readdir ( entry , function ( er , files ) {
6262 if ( er ) {
63- that . emit ( 'error' , er , target , stat )
63+ that . emit ( 'error' , er , entry , stat )
6464 that . doneOne ( )
6565 return
6666 }
6767
68- that . emit ( 'entry' , target , stat )
69- that . emit ( 'dir' , target , stat )
68+ that . emit ( 'entry' , entry , stat )
69+ that . emit ( 'dir' , entry , stat )
7070 files . forEach ( function ( part ) {
71- that . go ( path . join ( target , part ) )
71+ that . go ( path . join ( entry , part ) )
7272 } )
7373 that . doneOne ( )
7474 } )
7575 }
7676 } else if ( stat . isSymbolicLink ( ) ) {
77- that . emit ( 'entry' , target , stat )
78- that . emit ( 'symlink' , target , stat )
77+ that . emit ( 'entry' , entry , stat )
78+ that . emit ( 'symlink' , entry , stat )
7979 that . doneOne ( )
8080 } else if ( stat . isBlockDevice ( ) ) {
81- that . emit ( 'entry' , target , stat )
82- that . emit ( 'blockDevice' , target , stat )
81+ that . emit ( 'entry' , entry , stat )
82+ that . emit ( 'blockDevice' , entry , stat )
8383 that . doneOne ( )
8484 } else if ( stat . isCharacterDevice ( ) ) {
85- that . emit ( 'entry' , target , stat )
86- that . emit ( 'characterDevice' , target , stat )
85+ that . emit ( 'entry' , entry , stat )
86+ that . emit ( 'characterDevice' , entry , stat )
8787 that . doneOne ( )
8888 } else if ( stat . isFIFO ( ) ) {
89- that . emit ( 'entry' , target , stat )
90- that . emit ( 'fifo' , target , stat )
89+ that . emit ( 'entry' , entry , stat )
90+ that . emit ( 'fifo' , entry , stat )
9191 that . doneOne ( )
9292 } else if ( stat . isSocket ( ) ) {
93- that . emit ( 'entry' , target , stat )
94- that . emit ( 'socket' , target , stat )
93+ that . emit ( 'entry' , entry , stat )
94+ that . emit ( 'socket' , entry , stat )
9595 that . doneOne ( )
9696 } else if ( stat . isFile ( ) ) {
97- that . emit ( 'entry' , target , stat )
98- that . emit ( 'file' , target , stat )
97+ that . emit ( 'entry' , entry , stat )
98+ that . emit ( 'file' , entry , stat )
9999 that . doneOne ( )
100100 } else {
101- that . emit ( 'error' , UnknownFileTypeError ( ) , target , stat )
101+ that . emit ( 'error' , UnknownFileTypeError ( ) , entry , stat )
102102 that . doneOne ( )
103103 }
104104 } )
0 commit comments