aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-worker1.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-03-05 07:44:23 +0000
committerstephan <stephan@noemail.net>2023-03-05 07:44:23 +0000
commiteac6e8cb6a177500422de07f75a089cad162c5f2 (patch)
tree750e5d94f10a6861e31a5e34aba5013f81f2c814 /ext/wasm/api/sqlite3-worker1.c-pp.js
parent32b3444f1518d02898ea0b8cbd5a73c7a142cb2a (diff)
downloadsqlite-eac6e8cb6a177500422de07f75a089cad162c5f2.tar.gz
sqlite-eac6e8cb6a177500422de07f75a089cad162c5f2.zip
Rename sqlite3-worker1-bundler-friendly.js to sqlite3-worker1-bundler-friendly.mjs and refactor it to work as an ES6 module, based on feedback in [forum post a255f89c2eadf4c4|forum:a255f89c2eadf4c4].
FossilOrigin-Name: af312b131457743d98b84137bd51d9ba60e0daf0bd8f5a66f05956ca35ab68fb
Diffstat (limited to 'ext/wasm/api/sqlite3-worker1.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-worker1.c-pp.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/wasm/api/sqlite3-worker1.c-pp.js b/ext/wasm/api/sqlite3-worker1.c-pp.js
index 9e9c3ac42..906a6ce0d 100644
--- a/ext/wasm/api/sqlite3-worker1.c-pp.js
+++ b/ext/wasm/api/sqlite3-worker1.c-pp.js
@@ -31,11 +31,11 @@
- `sqlite3.dir`, if set, treats the given directory name as the
directory from which `sqlite3.js` will be loaded.
*/
-"use strict";
-(()=>{
//#if target=es6-bundler-friendly
- importScripts('sqlite3.js');
+import {default as sqlite3InitModule} from './sqlite3-bundler-friendly.mjs';
//#else
+"use strict";
+{
const urlParams = new URL(self.location.href).searchParams;
let theJs = 'sqlite3.js';
if(urlParams.has('sqlite3.dir')){
@@ -43,8 +43,6 @@
}
//console.warn("worker1 theJs =",theJs);
importScripts(theJs);
+}
//#endif
- sqlite3InitModule().then((sqlite3)=>{
- sqlite3.initWorker1API();
- });
-})();
+sqlite3InitModule().then(sqlite3 => sqlite3.initWorker1API());