aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-cleanup.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-10-16 15:38:03 +0000
committerstephan <stephan@noemail.net>2022-10-16 15:38:03 +0000
commit956392694abaaa832ec3186f7b6af5043f71e623 (patch)
tree2ada9a4e82af9e423971afc30c4ff1557dac10ea /ext/wasm/api/sqlite3-api-cleanup.js
parent879164ed74846a4bdfcd513c200c70debf0b9409 (diff)
downloadsqlite-956392694abaaa832ec3186f7b6af5043f71e623.tar.gz
sqlite-956392694abaaa832ec3186f7b6af5043f71e623.zip
Add a top-level license and build-time version info header to generated sqlite3*.js. Correct a broken link in ext/wasm/index.html.
FossilOrigin-Name: 0f1a06e8e39a1fbc74f1aff9cc59787282dfbf847d6c5c7edb3f7d410db0e4b7
Diffstat (limited to 'ext/wasm/api/sqlite3-api-cleanup.js')
-rw-r--r--ext/wasm/api/sqlite3-api-cleanup.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/ext/wasm/api/sqlite3-api-cleanup.js b/ext/wasm/api/sqlite3-api-cleanup.js
index c2a342589..555e5d31c 100644
--- a/ext/wasm/api/sqlite3-api-cleanup.js
+++ b/ext/wasm/api/sqlite3-api-cleanup.js
@@ -20,17 +20,15 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
/**
Install a suitable default configuration for sqlite3ApiBootstrap().
*/
- const SABC = self.sqlite3ApiConfig || Object.create(null);
- if(undefined===SABC.Module){
- SABC.Module = Module /* ==> Currently needs to be exposed here for
- test code. NOT part of the public API. */;
- }
- if(undefined===SABC.exports){
- SABC.exports = Module['asm'];
- }
- if(undefined===SABC.memory){
- SABC.memory = Module.wasmMemory /* gets set if built with -sIMPORT_MEMORY */;
- }
+ const SABC = Object.assign(
+ Object.create(null), {
+ Module: Module /* ==> Currently needs to be exposed here for
+ test code. NOT part of the public API. */,
+ exports: Module['asm'],
+ memory: Module.wasmMemory /* gets set if built with -sIMPORT_MEMORY */
+ },
+ self.sqlite3ApiConfig || Object.create(null)
+ );
/**
For current (2022-08-22) purposes, automatically call
@@ -38,10 +36,11 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
point, as we really want client code to be able to call this to
configure certain parts. Clients may modify
self.sqlite3ApiBootstrap.defaultConfig to tweak the default
- configuration used by a no-args call to sqlite3ApiBootstrap().
+ configuration used by a no-args call to sqlite3ApiBootstrap(),
+ but must have first loaded their WASM module in order to be
+ able to provide the necessary configuration state.
*/
//console.warn("self.sqlite3ApiConfig = ",self.sqlite3ApiConfig);
- const rmApiConfig = (SABC !== self.sqlite3ApiConfig);
self.sqlite3ApiConfig = SABC;
let sqlite3;
try{
@@ -51,7 +50,7 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build
throw e;
}finally{
delete self.sqlite3ApiBootstrap;
- if(rmApiConfig) delete self.sqlite3ApiConfig;
+ delete self.sqlite3ApiConfig;
}
if(self.location && +self.location.port > 1024){