diff options
author | stephan <stephan@noemail.net> | 2023-08-01 16:38:08 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-08-01 16:38:08 +0000 |
commit | 887f6e5082bdd8cc3247d38eebbfc3b813964db3 (patch) | |
tree | a31a287e6099492be87393834b45e1bf3588caa7 /ext/wasm | |
parent | a08d363f67e69e5e696d3861846abfb09df61280 (diff) | |
download | sqlite-887f6e5082bdd8cc3247d38eebbfc3b813964db3.tar.gz sqlite-887f6e5082bdd8cc3247d38eebbfc3b813964db3.zip |
Fix part 2 of 2 for /fiddle: a make deps problem which caused fiddle to load but fail to run when sqlite3.c was missing.
FossilOrigin-Name: 6011bc26764760af750de68f1553f45382766dd2195633ae267bdb4f9ac75d0f
Diffstat (limited to 'ext/wasm')
-rw-r--r-- | ext/wasm/fiddle.make | 2 | ||||
-rw-r--r-- | ext/wasm/fiddle/fiddle-worker.js | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/ext/wasm/fiddle.make b/ext/wasm/fiddle.make index 3d1dc3f90..57141d7e2 100644 --- a/ext/wasm/fiddle.make +++ b/ext/wasm/fiddle.make @@ -18,7 +18,7 @@ endif ifeq (,$(SHELL_SRC)) $(error Could not parse SHELL_SRC from $(dir.top)/Makefile.) endif -$(dir.top)/shell.c: $(SHELL_SRC) $(dir.top)/tool/mkshellc.tcl +$(dir.top)/shell.c: $(SHELL_SRC) $(dir.top)/tool/mkshellc.tcl $(sqlite3.c) $(MAKE) -C $(dir.top) shell.c # /shell.c ######################################################################## diff --git a/ext/wasm/fiddle/fiddle-worker.js b/ext/wasm/fiddle/fiddle-worker.js index e239cbf51..67f61008f 100644 --- a/ext/wasm/fiddle/fiddle-worker.js +++ b/ext/wasm/fiddle/fiddle-worker.js @@ -221,7 +221,7 @@ f._(); } }; - + self.onmessage = function f(ev){ ev = ev.data; if(!f.cache){ @@ -371,12 +371,14 @@ sqlite3InitModule(fiddleModule).then((_sqlite3)=>{ sqlite3 = _sqlite3; console.warn("Installing sqlite3 module globally (in Worker)", - "for use in the dev console."); - self.sqlite3 = sqlite3; + "for use in the dev console.", sqlite3); + globalThis.sqlite3 = sqlite3; const dbVfs = sqlite3.wasm.xWrap('fiddle_db_vfs', "*", ['string']); fiddleModule.fsUnlink = (fn)=>{ return sqlite3.wasm.sqlite3_wasm_vfs_unlink(dbVfs(0), fn); }; wMsg('fiddle-ready'); - })/*then()*/; + }).catch(e=>{ + console.error("Fiddle worker init failed:",e); + }); })(); |