mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Tweak sqlite3-worker1.js to be able to load either sqlite3.js or sqlite3-wasmfs.js, noting that the latter still does not load in a Worker because of an Emscripten loader bug.
FossilOrigin-Name: 000ef7059bfb54dc4f829b81a8d8c927c0382980218d8a3d60cd2c4d89151c90
This commit is contained in:
@ -27,8 +27,13 @@
|
||||
above in order to know when the module has completed initialization.
|
||||
*/
|
||||
"use strict";
|
||||
importScripts('sqlite3.js');
|
||||
sqlite3InitModule().then((sqlite3)=>{
|
||||
sqlite3.capi.sqlite3_wasmfs_opfs_dir();
|
||||
sqlite3.initWorker1API();
|
||||
});
|
||||
(()=>{
|
||||
const urlParams = new URL(self.location.href).searchParams;
|
||||
importScripts(urlParams.has('wasmfs')
|
||||
? 'sqlite3-wasmfs.js'
|
||||
: 'sqlite3.js');
|
||||
sqlite3InitModule().then((sqlite3)=>{
|
||||
sqlite3.capi.sqlite3_wasmfs_opfs_dir();
|
||||
sqlite3.initWorker1API();
|
||||
});
|
||||
})();
|
||||
|
Reference in New Issue
Block a user