File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -500,20 +500,14 @@ class StatusLoader {
500500
501501 load ( ) {
502502 const dir = path . join ( __dirname , '..' , 'wpt' ) ;
503- const jsonFile = path . join ( dir , 'status' , `${ this . path } .json` ) ;
504503 let result ;
505504
506- let fd ;
507505 try {
508- fd = fs . openSync ( jsonFile , 'r' ) ;
506+ this . statusFile = `${ this . path } .json` ;
507+ const jsonFile = path . join ( dir , 'status' , this . statusFile ) ;
508+ result = JSON . parse ( fs . readFileSync ( jsonFile , 'utf8' ) ) ;
509509 } catch ( err ) {
510510 if ( err ?. code !== 'ENOENT' ) throw err ;
511- }
512- if ( fd ) {
513- this . statusFile = `${ this . path } .json` ;
514- result = JSON . parse ( fs . readFileSync ( fd , 'utf8' ) ) ;
515- fs . closeSync ( fd ) ;
516- } else {
517511 this . statusFile = `${ this . path } .cjs` ;
518512 result = require ( path . join ( dir , 'status' , this . statusFile ) ) ;
519513 }
You can’t perform that action at this time.
0 commit comments