This repository was archived by the owner on Jan 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -673,8 +673,9 @@ var modifyNativeAddonWin32 = (function () {
673
673
// write /////////////////////////////////////////////////////////
674
674
// ///////////////////////////////////////////////////////////////
675
675
676
- function writeToSnapshot ( ) {
677
- throw new Error ( 'Cannot write to packaged file' ) ;
676
+ function writeToSnapshot ( cb ) {
677
+ var cb2 = cb || rethrow ;
678
+ return cb2 ( new Error ( 'Cannot write to packaged file' ) ) ;
678
679
}
679
680
680
681
fs . writeSync = function ( fd ) {
@@ -690,17 +691,8 @@ var modifyNativeAddonWin32 = (function () {
690
691
return ancestor . write . apply ( fs , arguments ) ;
691
692
}
692
693
693
- var callback = maybeCallback ( arguments ) ;
694
- try {
695
- var r = writeToSnapshot ( ) ;
696
- process . nextTick ( function ( ) {
697
- callback ( null , r , buffer ) ;
698
- } ) ;
699
- } catch ( error ) {
700
- process . nextTick ( function ( ) {
701
- callback ( error ) ;
702
- } ) ;
703
- }
694
+ var callback = dezalgo ( maybeCallback ( arguments ) ) ;
695
+ writeToSnapshot ( callback ) ;
704
696
} ;
705
697
706
698
// ///////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments