diff options
author | stephan <stephan@noemail.net> | 2022-09-29 16:54:23 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-09-29 16:54:23 +0000 |
commit | eb97743cc7141d224a53ae23f08de65a58dd3627 (patch) | |
tree | 514f26ae98fb50e7a6e1033750ce2e3764828928 /ext/wasm/api | |
parent | b94a98607a3bd4dd55f4d5ce16f171ba066bafb2 (diff) | |
download | sqlite-eb97743cc7141d224a53ae23f08de65a58dd3627.tar.gz sqlite-eb97743cc7141d224a53ae23f08de65a58dd3627.zip |
Finish eliminating explicit Emscripten module dependencies in test code and fiddle. The only remnant in public code is the Emscripten-generated module load/init interface.
FossilOrigin-Name: 7be78dd4efc410f13ff1ceda1fad82b309cc24de2d5106c8bd6b2adeaa13b106
Diffstat (limited to 'ext/wasm/api')
-rw-r--r-- | ext/wasm/api/sqlite3-api-cleanup.js | 4 | ||||
-rw-r--r-- | ext/wasm/api/sqlite3-api-prologue.js | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/ext/wasm/api/sqlite3-api-cleanup.js b/ext/wasm/api/sqlite3-api-cleanup.js index a612681af..12d766886 100644 --- a/ext/wasm/api/sqlite3-api-cleanup.js +++ b/ext/wasm/api/sqlite3-api-cleanup.js @@ -58,8 +58,8 @@ if('undefined' !== typeof Module){ // presumably an Emscripten build /* Clean up temporary references to our APIs... */ delete sqlite3.capi.util /* arguable, but these are (currently) internal-use APIs */; - Module.sqlite3 = sqlite3 /* Currently needed by test code and sqlite3-worker1.js */; - //console.warn("Module.sqlite3 =",Module.sqlite3); + Module.sqlite3 = sqlite3 /* Needed for customized sqlite3InitModule() to be able to + pass the sqlite3 object off to the client. */; }else{ console.warn("This is not running in an Emscripten module context, so", "self.sqlite3ApiBootstrap() is _not_ being called due to lack", diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js index 859c46bd4..c14756eaa 100644 --- a/ext/wasm/api/sqlite3-api-prologue.js +++ b/ext/wasm/api/sqlite3-api-prologue.js @@ -93,10 +93,6 @@ The config object properties include: - - `Module`[^1]: Emscripten-style module object. Currently only required - by certain test code and is _not_ part of the public interface. - (TODO: rename this to EmscriptenModule to be more explicit.) - - `exports`[^1]: the "exports" object for the current WASM environment. In an Emscripten build, this should be set to `Module['asm']`. @@ -144,12 +140,11 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( const config = Object.create(null); { const configDefaults = { - Module: undefined/*needed for some test code, not part of the public API*/, exports: undefined, memory: undefined, bigIntEnabled: (()=>{ if('undefined'!==typeof Module){ - /* Emscripten module will contain HEAPU64 when build with + /* Emscripten module will contain HEAPU64 when built with -sWASM_BIGINT=1, else it will not. */ return !!Module.HEAPU64; } @@ -174,7 +169,7 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( [ // If any of these config options are functions, replace them with // the result of calling that function... - 'Module', 'exports', 'memory', 'wasmfsOpfsDir' + 'exports', 'memory', 'wasmfsOpfsDir' ].forEach((k)=>{ if('function' === typeof config[k]){ config[k] = config[k](); |