File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2016,7 +2016,7 @@ ReadStream.prototype.close = function(cb) {
2016
2016
2017
2017
if ( this . closed || typeof this . fd !== 'number' ) {
2018
2018
if ( typeof this . fd !== 'number' ) {
2019
- this . once ( 'open' , this . close . bind ( this , null ) ) ;
2019
+ this . once ( 'open' , closeOnOpen ) ;
2020
2020
return ;
2021
2021
}
2022
2022
return process . nextTick ( ( ) => this . emit ( 'close' ) ) ;
@@ -2034,6 +2034,11 @@ ReadStream.prototype.close = function(cb) {
2034
2034
this . fd = null ;
2035
2035
} ;
2036
2036
2037
+ // needed because as it will be called with arguments
2038
+ // that does not match this.close() signature
2039
+ function closeOnOpen ( fd ) {
2040
+ this . close ( ) ;
2041
+ }
2037
2042
2038
2043
fs . createWriteStream = function ( path , options ) {
2039
2044
return new WriteStream ( path , options ) ;
You can’t perform that action at this time.
0 commit comments