aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/pre-js.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2023-01-28 04:20:46 +0000
committerstephan <stephan@noemail.net>2023-01-28 04:20:46 +0000
commit65f7942d0678a56f788d54a636c9c30ed63b5ee6 (patch)
treed3d7ad55512c95b9ca137d605d7e0b760f8bf687 /ext/wasm/api/pre-js.c-pp.js
parentcfd01014d0b5657a8b48d4c828405703cce9e941 (diff)
parent69141f52be6368d3510b551c74029e3600b6f4c2 (diff)
downloadsqlite-65f7942d0678a56f788d54a636c9c30ed63b5ee6.tar.gz
sqlite-65f7942d0678a56f788d54a636c9c30ed63b5ee6.zip
Add JS bundler-friendly JS build. Minor test code cleanups.
FossilOrigin-Name: 24d3a53dea5e596230558e233cbbd9d0288b4c394cd5ea7b650fd99bff4cde2e
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, 8 insertions, 5 deletions
diff --git a/ext/wasm/api/pre-js.c-pp.js b/ext/wasm/api/pre-js.c-pp.js
index 5d8e58864..a25c7ce77 100644
--- a/ext/wasm/api/pre-js.c-pp.js
+++ b/ext/wasm/api/pre-js.c-pp.js
@@ -6,12 +6,14 @@
*/
// See notes in extern-post-js.js
-const sqlite3InitModuleState = self.sqlite3InitModuleState || Object.assign(Object.create(null),{
- debugModule: ()=>{}
-});
+const sqlite3InitModuleState = self.sqlite3InitModuleState
+ || Object.assign(Object.create(null),{
+ debugModule: ()=>{}
+ });
delete self.sqlite3InitModuleState;
sqlite3InitModuleState.debugModule('self.location =',self.location);
+//#ifnot target=es6-bundler-friendly
/**
This custom locateFile() tries to figure out where to load `path`
from. The intent is to provide a way for foo/bar/X.js loaded from a
@@ -53,8 +55,9 @@ Module['locateFile'] = function(path, prefix) {
"result =", theFile
);
return theFile;
-//#endif /* SQLITE_JS_EMS */
+//#endif target=es6-module
}.bind(sqlite3InitModuleState);
+//#endif ifnot target=es6-bundler-friendly
/**
Bug warning: a custom Module.instantiateWasm() does not work
@@ -64,7 +67,7 @@ Module['locateFile'] = function(path, prefix) {
In such builds we must disable this.
*/
-const xNameOfInstantiateWasm = true
+const xNameOfInstantiateWasm = false
? 'instantiateWasm'
: 'emscripten-bug-17951';
Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){