1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

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
This commit is contained in:
stephan
2022-10-16 15:38:03 +00:00
parent 879164ed74
commit 956392694a
10 changed files with 88 additions and 35 deletions

View File

@ -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){