@@ -186,7 +186,7 @@ function mapOSTauriErrorMessage(tauriErrorMessage, path, userMessage= '') {
186186}
187187
188188async function _getTauriStat ( vfsPath ) {
189- let stats = await window . __TAURI__ . invoke ( "plugin:fs-extra|metadata" , {
189+ let stats = await globalObject . __TAURI__ . invoke ( "plugin:fs-extra|metadata" , {
190190 path : globalObject . fs . getTauriPlatformPath ( vfsPath )
191191 } ) ;
192192 return Utils . createFromTauriStat ( vfsPath , stats ) ;
@@ -252,7 +252,7 @@ function readdir(path, options, callback) {
252252 options = { } ;
253253 }
254254
255- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
255+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
256256 return NodeTauriFS . readdir ( path , options , callback ) ;
257257 }
258258
@@ -325,7 +325,7 @@ function mkdirs(path, mode, recursive, callback) {
325325 } ;
326326 }
327327
328- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
328+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
329329 NodeTauriFS . mkdirs ( path , mode , recursive , callback ) ;
330330 return ;
331331 }
@@ -373,7 +373,7 @@ function mkdirs(path, mode, recursive, callback) {
373373 */
374374function stat ( path , callback , options = { } ) {
375375 path = globalObject . path . normalize ( path ) ;
376- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
376+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
377377 return NodeTauriFS . stat ( path , callback , options ) ;
378378 }
379379 _getTauriStat ( path )
@@ -388,7 +388,7 @@ function stat(path, callback, options= {}) {
388388function unlink ( path , callback ) {
389389 path = globalObject . path . normalize ( path ) ;
390390
391- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
391+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
392392 return NodeTauriFS . unlink ( path , callback ) ;
393393 }
394394
@@ -415,7 +415,7 @@ function rename(oldPath, newPath, callback) {
415415 oldPath = globalObject . path . normalize ( oldPath ) ;
416416 newPath = globalObject . path . normalize ( newPath ) ;
417417
418- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
418+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
419419 NodeTauriFS . rename ( oldPath , newPath , callback ) ;
420420 return ;
421421 }
@@ -502,7 +502,7 @@ function readFile(path, options, callback) {
502502 callback = arguments [ arguments . length - 1 ] ;
503503 options = Utils . validateFileOptions ( options , Constants . BINARY_ENCODING , 'r' ) ;
504504
505- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
505+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
506506 NodeTauriFS . readBinaryFile ( path )
507507 . then ( contents => {
508508 // contents is Array buffer
@@ -580,7 +580,7 @@ function writeFile (path, data, options, callback) {
580580 }
581581 arrayBuffer = Utils . getEncodedArrayBuffer ( data , options . encoding ) ;
582582 }
583- if ( ! window . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
583+ if ( ! globalObject . __TAURI__ || forceNodeWs || ( preferNodeWs && NodeTauriFS . isNodeWSReady ( ) ) ) {
584584 NodeTauriFS . writeBinaryFile ( path , options . mode || 0o666 , options . flag , arrayBuffer )
585585 . then ( ( ) => {
586586 callback ( null ) ;
0 commit comments