1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add capability to override the JS's use of console.log/debug/warn/error() with client-provided versions via the bootstrap-time config object.

FossilOrigin-Name: c54f29d8e55419eaa9168e799dab5030e89063b13d8390a50616606422d164dc
This commit is contained in:
stephan
2023-02-06 14:01:19 +00:00
parent ee18659f69
commit 3ff812aa94
9 changed files with 59 additions and 41 deletions

View File

@@ -2972,6 +2972,14 @@ self.sqlite3InitModule = sqlite3InitModule;
////////////////////////////////////////////////////////////////////////
log("Loading and initializing sqlite3 WASM module...");
if(0){
self.sqlite3ApiConfig = {
debug: ()=>{},
log: ()=>{},
warn: ()=>{},
error: ()=>{}
}
}
if(!self.sqlite3InitModule && !isUIThread()){
/* Vanilla worker, as opposed to an ES6 module worker */
/*
@@ -3004,7 +3012,7 @@ self.sqlite3InitModule = sqlite3InitModule;
}).then(function(sqlite3){
//console.log('sqlite3 =',sqlite3);
log("Done initializing WASM/JS bits. Running tests...");
console.warn("Installing sqlite3 bits as global S for local dev/test purposes.");
sqlite3.config.warn("Installing sqlite3 bits as global S for local dev/test purposes.");
self.S = sqlite3;
capi = sqlite3.capi;
wasm = sqlite3.wasm;