This repository was archived by the owner on Jan 13, 2024. It is now read-only.
File tree 1 file changed +8
-13
lines changed 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -699,9 +699,13 @@ var modifyNativeAddonWin32 = (function () {
699
699
// close /////////////////////////////////////////////////////////
700
700
// ///////////////////////////////////////////////////////////////
701
701
702
- function closeFromSnapshot ( fd ) {
703
- ancestor . closeSync . call ( fs , fd ) ;
702
+ function closeFromSnapshot ( fd , cb ) {
704
703
delete docks [ fd ] ;
704
+ if ( cb ) {
705
+ ancestor . close . call ( fs , fd , cb ) ;
706
+ } else {
707
+ return ancestor . closeSync . call ( fs , fd ) ;
708
+ }
705
709
}
706
710
707
711
fs . closeSync = function ( fd ) {
@@ -717,17 +721,8 @@ var modifyNativeAddonWin32 = (function () {
717
721
return ancestor . close . apply ( fs , arguments ) ;
718
722
}
719
723
720
- var callback = maybeCallback ( arguments ) ;
721
- try {
722
- var r = closeFromSnapshot ( fd ) ;
723
- process . nextTick ( function ( ) {
724
- callback ( null , r ) ;
725
- } ) ;
726
- } catch ( error ) {
727
- process . nextTick ( function ( ) {
728
- callback ( error ) ;
729
- } ) ;
730
- }
724
+ var callback = dezalgo ( maybeCallback ( arguments ) ) ;
725
+ closeFromSnapshot ( fd , callback ) ;
731
726
} ;
732
727
733
728
// ///////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments