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

@@ -6,14 +6,13 @@ tags: [[$:/tags/test-spec]]
Tests the SQL tiddler store layer
\*/
if($tw.node) {
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
if($tw.node) {
describe("SQL tiddler store with node-sqlite3-wasm", function() {
runSqlStoreTests("wasm");
});
@@ -145,6 +144,6 @@ function runSqlStoreTests(engine) {
});
}
}
})();
}