aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/pre-js.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-09-24 00:31:08 +0000
committerstephan <stephan@noemail.net>2024-09-24 00:31:08 +0000
commit405ae974eeaa99114593bb49e2d4951892adcced (patch)
tree14849c4eb56751d64d75078d00c894c5892b001c /ext/wasm/api/pre-js.c-pp.js
parent6ed21e8fd7597a80b8815e9c4eb8064264cd87a9 (diff)
downloadsqlite-405ae974eeaa99114593bb49e2d4951892adcced.tar.gz
sqlite-405ae974eeaa99114593bb49e2d4951892adcced.zip
Further wasm build cleanups and tweaks. No functional changes.
FossilOrigin-Name: 3b72a143431537ec275aefae739e56330c1d445c9ea80885882a2b9aa2201179
Diffstat (limited to 'ext/wasm/api/pre-js.c-pp.js')
-rw-r--r--ext/wasm/api/pre-js.c-pp.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/wasm/api/pre-js.c-pp.js b/ext/wasm/api/pre-js.c-pp.js
index 878f3e054..06d44a7a6 100644
--- a/ext/wasm/api/pre-js.c-pp.js
+++ b/ext/wasm/api/pre-js.c-pp.js
@@ -59,6 +59,7 @@ Module['locateFile'] = function(path, prefix) {
}.bind(sqlite3InitModuleState);
//#endif ifnot target=es6-bundler-friendly
+//#if custom-Module.instantiateModule
/**
Bug warning: a custom Module.instantiateWasm() does not work
in WASMFS builds:
@@ -67,7 +68,15 @@ Module['locateFile'] = function(path, prefix) {
In such builds we must disable this.
*/
-const xNameOfInstantiateWasm = false
+const xNameOfInstantiateWasm =
+//#if wasmfs
+ false
+//#else
+ true /* This works, but it does not have the testing coverage in the
+ wild which Emscripten's default impl does, so we'll save
+ this option until we really need a custom
+ Module.instantiateWasm() */
+//#endif
? 'instantiateWasm'
: 'emscripten-bug-17951';
Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
@@ -80,6 +89,7 @@ Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
sqlite3InitModuleState.debugModule(
"instantiateWasm() uri =", uri
);
+ //console.warn("Custom instantiateModule",uri);
const wfetch = ()=>fetch(uri, {credentials: 'same-origin'});
const loadWasm = WebAssembly.instantiateStreaming
? async ()=>{
@@ -105,6 +115,7 @@ Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
scripts.
*/
Module[xNameOfInstantiateWasm].uri = 'sqlite3.wasm';
+//#endif custom-Module.instantiateModule
/* END FILE: api/pre-js.js, noting that the build process may add a
line after this one to change the above .uri to a build-specific
one. */