@@ -7,10 +7,10 @@ const {
77 MathMin,
88 NumberIsSafeInteger,
99 Promise,
10- PromisePrototypeFinally,
1110 PromisePrototypeThen,
1211 PromiseResolve,
1312 SafeArrayIterator,
13+ SafePromisePrototypeFinally,
1414 Symbol,
1515 Uint8Array,
1616} = primordials ;
@@ -186,12 +186,12 @@ class FileHandle extends EventEmitterMixin(JSTransferable) {
186186 this [ kRefs ] -- ;
187187 if ( this [ kRefs ] === 0 ) {
188188 this [ kFd ] = - 1 ;
189- this [ kClosePromise ] = PromisePrototypeFinally (
189+ this [ kClosePromise ] = SafePromisePrototypeFinally (
190190 this [ kHandle ] . close ( ) ,
191191 ( ) => { this [ kClosePromise ] = undefined ; }
192192 ) ;
193193 } else {
194- this [ kClosePromise ] = PromisePrototypeFinally (
194+ this [ kClosePromise ] = SafePromisePrototypeFinally (
195195 new Promise ( ( resolve , reject ) => {
196196 this [ kCloseResolve ] = resolve ;
197197 this [ kCloseReject ] = reject ;
@@ -507,7 +507,7 @@ async function rename(oldPath, newPath) {
507507
508508async function truncate ( path , len = 0 ) {
509509 const fd = await open ( path , 'r+' ) ;
510- return PromisePrototypeFinally ( ftruncate ( fd , len ) , fd . close ) ;
510+ return SafePromisePrototypeFinally ( ftruncate ( fd , len ) , fd . close ) ;
511511}
512512
513513async function ftruncate ( handle , len = 0 ) {
@@ -638,7 +638,7 @@ async function lchmod(path, mode) {
638638 throw new ERR_METHOD_NOT_IMPLEMENTED ( 'lchmod()' ) ;
639639
640640 const fd = await open ( path , O_WRONLY | O_SYMLINK ) ;
641- return PromisePrototypeFinally ( fchmod ( fd , mode ) , fd . close ) ;
641+ return SafePromisePrototypeFinally ( fchmod ( fd , mode ) , fd . close ) ;
642642}
643643
644644async function lchown ( path , uid , gid ) {
@@ -717,7 +717,7 @@ async function writeFile(path, data, options) {
717717 checkAborted ( options . signal ) ;
718718
719719 const fd = await open ( path , flag , options . mode ) ;
720- return PromisePrototypeFinally (
720+ return SafePromisePrototypeFinally (
721721 writeFileHandle ( fd , data , options . signal , options . encoding ) , fd . close ) ;
722722}
723723
@@ -742,7 +742,7 @@ async function readFile(path, options) {
742742 checkAborted ( options . signal ) ;
743743
744744 const fd = await open ( path , flag , 0o666 ) ;
745- return PromisePrototypeFinally ( readFileHandle ( fd , options ) , fd . close ) ;
745+ return SafePromisePrototypeFinally ( readFileHandle ( fd , options ) , fd . close ) ;
746746}
747747
748748module . exports = {
0 commit comments