/**
Performs any optional asynchronous library-level initialization
which might be required. This function returns a Promise which
- resolves to the sqlite3 namespace object. It _ignores any
- errors_ in the asynchronous init process, as such components
- are all optional. If called more than once, the second and
+ resolves to the sqlite3 namespace object. Any error in the
+ async init will be fatal to the init as a whole, but init
+ routines are themselves welcome to install dummy catch()
+ handlers which are not fatal if their failure should be
+ considered non-fatal. If called more than once, the second and
subsequent calls are no-ops which return a pre-resolved
Promise.
// Is it okay to resolve these in parallel or do we need them
// to resolve in order? We currently only have 1, so it
// makes no difference.
- lip = lip.map((f)=>f(sqlite3).catch((e)=>{
- console.error("Ignoring error: an async sqlite3 initializer failed:",e);
- }));
+ lip = lip.map((f)=>{
+ const p = (f instanceof Promise) ? f : f(sqlite3);
+ return p.catch((e)=>{
+ console.error("an async sqlite3 initializer failed:",e);
+ throw e;
+ });
+ });
//let p = lip.shift();
//while(lip.length) p = p.then(lip.shift());
//return p.then(()=>sqlite3);
this array is deleted.
Note that the order of insertion into this array is significant for
- some pieces. e.g. sqlite3.capi.wasm cannot be fully utilized until
- the whwasmutil.js part is plugged in via sqlite3-api-glue.js.
+ some pieces. e.g. sqlite3.capi and sqlite3.capi.wasm cannot be fully
+ utilized until the whwasmutil.js part is plugged in via
+ sqlite3-api-glue.js.
*/
self.sqlite3ApiBootstrap.initializers = [];
/**
modified by client code except when plugging such code into the
amalgamation process.
- Counterpart of self.sqlite3ApiBootstrap.initializers, specifically
- for initializers which are asynchronous. All functions in this list
- take the sqlite3 object as their argument and MUST return a
- Promise. The resolved value and ignored and rejection will kill the
- asyncPostInit() process but will be otherwise ignored because the
- post-synchronous-init async initialization parts are (as of this
- writing) all optional.
+ The counterpart of self.sqlite3ApiBootstrap.initializers,
+ specifically for initializers which are asynchronous. All entries in
+ this list must be either async functions, non-async functions which
+ return a Promise, or a Promise. Each function in the list is called
+ with the sqlite3 ojbect as its only argument.
+
+ The resolved value of any Promise is ignored and rejection will kill
+ the asyncPostInit() process (at an indeterminate point because all
+ of them are run asynchronously in parallel).
This list is not processed until the client calls
sqlite3.asyncPostInit(). This means, for example, that intializers
-C Remove\sext/wasm/kvvfs.make\swhich\swas\sinadvertently\sresurrected\sin\s[92b500da70a3].
-D 2022-10-09T13:35:14.995
+C Minor\scleaups\sin\sthe\spost-init\sasync\sphase\sof\ssqlite3\smodule\sinitialization.
+D 2022-10-09T15:12:37.430
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F ext/wasm/api/sqlite3-api-cleanup.js 5d22d1d3818ecacb23bfa223d5970cd0617d8cdbb48c8bc4bbd463f05b021a99
F ext/wasm/api/sqlite3-api-glue.js 4e1403add52666f4cf36fc580ddb15b65bb8f9ccb446095f953aad6c9da2f324
F ext/wasm/api/sqlite3-api-oo1.js ac1e08d36bdfb5aa0a2d75b7d4c892fd51819d34c932370c3282810672bcc086
-F ext/wasm/api/sqlite3-api-opfs.js 78fd272d6ec4fe6da93910b978f693fff63beed8e0e5e7dab42a25dbdfefca4b
-F ext/wasm/api/sqlite3-api-prologue.js 2c860a257fc554bc6958c08c8e268e7f3d69813fd9e359032636a55c8e6f4405
+F ext/wasm/api/sqlite3-api-opfs.js 5a8ab3b76880c8ada8710ca9ba1ca5b160872edfd8bd5322e4f179a7f41cc616
+F ext/wasm/api/sqlite3-api-prologue.js daf288df965cab1e8eabee4451f6ba3beb03d5a579722b0b0f90e5203962f515
F ext/wasm/api/sqlite3-api-worker1.js 7f4f46cb6b512a48572d7567233896e6a9c46570c44bdc3d13419730c7c221c8
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
F ext/wasm/api/sqlite3-wasm.c ea456d398bda1c5f4b2c4a54512de7b9ca4513c2b0ab326b99a46fb51cef0b42
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P a9047e020a097b2259bc9935b63ca1c538a3a7f1d050e15f0d0a08cfb84acc7c
-R 883cefae3468ecd65dfcaec537518f1d
+P 2e7fa085fc0b1202c6502d89e2603ae76a93451754b07b32ab4f0211f213f980
+R b8107455a191243f8c2c52386f30d345
U stephan
-Z 3463e4479bd983b8852d635dda178090
+Z 2aa81e852e2755790733e84c20b847cc
# Remove this line to create a well-formed Fossil manifest.