aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-prologue.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-03-04 09:56:47 +0000
committerstephan <stephan@noemail.net>2024-03-04 09:56:47 +0000
commit2775f10ebcebc303fa18ab12bd1697ed0794fdcd (patch)
tree68fde23cfb062d0e9aa002a65f3630c4938b2cdb /ext/wasm/api/sqlite3-api-prologue.js
parentbae55a768505c448384985a9cf9ddcd18c8107ca (diff)
downloadsqlite-2775f10ebcebc303fa18ab12bd1697ed0794fdcd.tar.gz
sqlite-2775f10ebcebc303fa18ab12bd1697ed0794fdcd.zip
Document why the wasm build does not use Emscripten's -sSTRICT=1 flag and account for a behaviour change in emsdk 3.1.55 regarding the HEAPxyz symbols.
FossilOrigin-Name: f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7
Diffstat (limited to 'ext/wasm/api/sqlite3-api-prologue.js')
-rw-r--r--ext/wasm/api/sqlite3-api-prologue.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js
index 5fe587c14..c3cc25f43 100644
--- a/ext/wasm/api/sqlite3-api-prologue.js
+++ b/ext/wasm/api/sqlite3-api-prologue.js
@@ -137,8 +137,16 @@ globalThis.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
bigIntEnabled: (()=>{
if('undefined'!==typeof Module){
/* Emscripten module will contain HEAPU64 when built with
- -sWASM_BIGINT=1, else it will not. */
- return !!Module.HEAPU64;
+ -sWASM_BIGINT=1, else it will not.
+
+ As of emsdk 3.1.55, when building in strict mode, HEAPxyz
+ are only available if _explicitly_ included in the exports,
+ else they are not. We do not (as of 2024-03-04) use -sSTRICT
+ for the canonical builds.
+ */
+ if( !!Module.HEAPU64 ) return true;
+ /* Else fall through and hope for the best. Nobody _really_
+ builds this without BigInt support, do they? */
}
return !!globalThis.BigInt64Array;
})(),