1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

Cleanups and docs in the internal parts of the JS lib bootstrapping. More tinkering with the custom (but still disabled) wasm file loader.

FossilOrigin-Name: 35651d9ab5529da915500fc50ca3833a004d0b7a19d98e8fbf39234d94697aec
This commit is contained in:
stephan
2025-09-22 17:29:52 +00:00
parent 6ba22a75f3
commit 1ab3d7eafd
10 changed files with 130 additions and 80 deletions

View File

@@ -15,17 +15,26 @@
that it can finalize any setup and clean up any global symbols
temporarily used for setting up the API's various subsystems.
In Emscripten builds it's run in the context of a Module.postRun
handler.
In Emscripten builds it's run in the context of what amounts to a
Module.postRun handler, though it's no longer actually a postRun
handler because Emscripten 4.0 changed postRun semantics in an
incompatible way.
In terms of amalgamation code placement, this file is appended
immediately after the final sqlite3-api-*.js piece. Those files
cooperate to prepare sqlite3ApiBootstrap() and this file calls it.
It is run within a context which gives it access to Emscripten's
Module object, after sqlite3.wasm is loaded but before
sqlite3ApiBootstrap() has been called.
*/
'use strict';
if( 'undefined' !== typeof Module ){ // presumably an Emscripten build
try{
/**
The WASM-environment-dependent configuration for
sqlite3ApiBootstrap().
*/
const SABC = Object.assign(
/**
The WASM-environment-dependent configuration for
sqlite3ApiBootstrap().
*/
Object.create(null),
globalThis.sqlite3ApiConfig || {}, {
memory: ('undefined'!==typeof wasmMemory)