aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/post-js-header.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-08-11 09:18:09 +0000
committerstephan <stephan@noemail.net>2022-08-11 09:18:09 +0000
commit9289c47df720a2312ed50862adfd23448b979659 (patch)
treee25933370eb84e3c12a30d5d173d0ac7ce5c6dad /ext/wasm/api/post-js-header.js
parentf0d12d87fa252e5ca00e9a52642e203ec233dc7c (diff)
parent2315e834632fcdc9f0be844b7ef379a8fe704ab7 (diff)
downloadsqlite-9289c47df720a2312ed50862adfd23448b979659.tar.gz
sqlite-9289c47df720a2312ed50862adfd23448b979659.zip
Merge in wasm-cleanups branch, reorganizing and updating the wasm-related components.
FossilOrigin-Name: c072594d3de3d6893c5d4a9d68439b84d043325f105b0d065575765a6e66c196
Diffstat (limited to 'ext/wasm/api/post-js-header.js')
-rw-r--r--ext/wasm/api/post-js-header.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/ext/wasm/api/post-js-header.js b/ext/wasm/api/post-js-header.js
new file mode 100644
index 000000000..1763188a2
--- /dev/null
+++ b/ext/wasm/api/post-js-header.js
@@ -0,0 +1,26 @@
+/**
+ post-js-header.js is to be prepended to other code to create
+ post-js.js for use with Emscripten's --post-js flag. This code
+ requires that it be running in that context. The Emscripten
+ environment must have been set up already but it will not have
+ loaded its WASM when the code in this file is run. The function it
+ installs will be run after the WASM module is loaded, at which
+ point the sqlite3 WASM API bits will be set up.
+*/
+if(!Module.postRun) Module.postRun = [];
+Module.postRun.push(function(Module/*the Emscripten-style module object*/){
+ 'use strict';
+ /* This function will contain:
+
+ - post-js-header.js (this file)
+ - sqlite3-api-prologue.js => Bootstrapping bits to attach the rest to
+ - sqlite3-api-whwasmutil.js => Replacements for much of Emscripten's glue
+ - sqlite3-api-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-worker.js => Worker-based API
+ - sqlite3-api-cleanup.js => final API cleanup
+ - post-js-footer.js => closes this postRun() function
+
+ Whew!
+ */