aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/extern-post-js.c-pp.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/api/extern-post-js.c-pp.js')
-rw-r--r--ext/wasm/api/extern-post-js.c-pp.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/ext/wasm/api/extern-post-js.c-pp.js b/ext/wasm/api/extern-post-js.c-pp.js
index 691ad7685..a577a63e1 100644
--- a/ext/wasm/api/extern-post-js.c-pp.js
+++ b/ext/wasm/api/extern-post-js.c-pp.js
@@ -9,7 +9,7 @@
Emscripten-generated module init scope, in the current
global scope. */
//#if target=es6-module
-const toExportForES6 =
+const toExportForESM =
//#endif
(function(){
/**
@@ -45,23 +45,14 @@ const toExportForES6 =
moduleScript: self?.document?.currentScript,
isWorker: ('undefined' !== typeof WorkerGlobalScope),
location: self.location,
- urlParams:
-//#if target=es6-bundler-friendly
- undefined
-//#else
- new URL(self.location.href).searchParams
-//#endif
+ urlParams: new URL(self.location.href).searchParams
});
initModuleState.debugModule =
-//#if target=es6-bundler-friendly
- ()=>{}
-//#else
- (new URL(self.location.href).searchParams).has('sqlite3.debugModule')
+ initModuleState.urlParams.has('sqlite3.debugModule')
? (...args)=>console.warn('sqlite3.debugModule:',...args)
: ()=>{};
-//#endif
- if(initModuleState.urlParams && initModuleState.urlParams.has('sqlite3.dir')){
+ if(initModuleState.urlParams.has('sqlite3.dir')){
initModuleState.sqlite3Dir = initModuleState.urlParams.get('sqlite3.dir') +'/';
}else if(initModuleState.moduleScript){
const li = initModuleState.moduleScript.src.split('/');
@@ -116,8 +107,8 @@ const toExportForES6 =
}
//#ifnot target=es6-module
// Emscripten does not inject these module-loader bits in ES6 module
-// build and including them here breaks JS bundlers, so elide them
-// from ES6 builds.
+// builds and including them here breaks JS bundlers, so elide them
+// from ESM builds.
/* Replace the various module exports performed by the Emscripten
glue... */
if (typeof exports === 'object' && typeof module === 'object'){
@@ -131,5 +122,5 @@ const toExportForES6 =
return self.sqlite3InitModule /* required for ESM */;
})();
//#if target=es6-module
-export default toExportForES6;
+export default toExportForESM;
//#endif