diff options
author | stephan <stephan@noemail.net> | 2025-01-16 09:27:40 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2025-01-16 09:27:40 +0000 |
commit | 3202b11f66aaeac6dd86f64f3d38dff9e3464b86 (patch) | |
tree | 689465a289b094ad0c75d73ad3acba2d682a5367 /ext/wasm/api/post-js-header.js | |
parent | c5dd908c89436a2c1006a858ea7ebed84836453b (diff) | |
download | sqlite-3202b11f66aaeac6dd86f64f3d38dff9e3464b86.tar.gz sqlite-3202b11f66aaeac6dd86f64f3d38dff9e3464b86.zip |
Replace use of Emscripten's Module.postRun() with a custom callback so that we get consistent library init timing with both Emscripten 3.1.x and 4.0.x. Details and discussion are in [https://github.com/emscripten-core/emscripten/issues/23420|Emscripten ticket #23420].
FossilOrigin-Name: 4863a70ac61ff6f868429f16f0141484ea98f973fde1a9aff879252d0f1dbb6b
Diffstat (limited to 'ext/wasm/api/post-js-header.js')
-rw-r--r-- | ext/wasm/api/post-js-header.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/wasm/api/post-js-header.js b/ext/wasm/api/post-js-header.js index d0778b980..a543c14f3 100644 --- a/ext/wasm/api/post-js-header.js +++ b/ext/wasm/api/post-js-header.js @@ -7,8 +7,12 @@ installs will be run after the WASM module is loaded, at which point the sqlite3 JS API bits will get set up. */ -if(!Module.postRun) Module.postRun = []; -Module.postRun.push(function(Module/*the Emscripten-style module object*/){ +Module.runSQLite3PostLoadInit = function(EmscriptenModule/*the Emscripten-style module object*/){ + /** ^^^ As don't use Module.postRun, as that runs a different time + depending on whether this file is built with emcc 3.1.x or + 4.0.x. This function name is intentionally obnoxiously verbose to + ensure that we don't collide with current and future Emscripten + symbol names. */ 'use strict'; //console.warn("This is the start of the Module.postRun handler."); /* This function will contain at least the following: @@ -16,9 +20,9 @@ Module.postRun.push(function(Module/*the Emscripten-style module object*/){ - post-js-header.js (this file) - sqlite3-api-prologue.js => Bootstrapping bits to attach the rest to - common/whwasmutil.js => Replacements for much of Emscripten's glue - - jaccwaby/jaccwabyt.js => Jaccwabyt (C/JS struct binding) + - jaccwabyt/jaccwabyt.js => Jaccwabyt (C/JS struct binding) - sqlite3-api-glue.js => glues previous parts together - - sqlite3-api-oo.js => SQLite3 OO API #1 + - sqlite3-api-oo1.js => SQLite3 OO API #1 - sqlite3-api-worker1.js => Worker-based API - sqlite3-vfs-helper.c-pp.js => Utilities for VFS impls - sqlite3-vtab-helper.c-pp.js => Utilities for virtual table impls |