1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-29 13:35:15 +00:00

Refactor conditional function definitions

Function definitions within a condition do not function as expected thanks to JS hoisting, so it is better to avoid it, and keep ESLint happy as well.

See discussion at #8622 with @pmario
This commit is contained in:
Jeremy Ruston
2024-09-30 15:28:37 +01:00
parent 517dae8242
commit 6dd6b7bef1
3 changed files with 8 additions and 8 deletions

View File

@@ -7,6 +7,7 @@ Tests attachments.
\*/
if(typeof window === 'undefined' && typeof process !== 'undefined' && process.versions && process.versions.node) {
(function(){
var fs = require('fs');
var path = require('path');
var assert = require('assert');
@@ -178,4 +179,5 @@ if(typeof window === 'undefined' && typeof process !== 'undefined' && process.ve
});
}
})();
})();
}