diff --git a/ext/wasm/api/sqlite3-api-glue.js b/ext/wasm/api/sqlite3-api-glue.js index d096af1c89..16840e79f3 100644 --- a/ext/wasm/api/sqlite3-api-glue.js +++ b/ext/wasm/api/sqlite3-api-glue.js @@ -104,6 +104,10 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ : fI64Disabled(e[0]); } + /* There's no(?) need to expose bindingSignatures to clients, + implicitly making it part of the public interface. */ + delete wasm.bindingSignatures; + if(wasm.exports.sqlite3_wasm_db_error){ util.sqlite3_wasm_db_error = capi.wasm.xWrap( 'sqlite3_wasm_db_error', 'int', 'sqlite3*', 'int', 'string' @@ -115,20 +119,20 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ }; } - /** - When registering a VFS and its related components it may be - necessary to ensure that JS keeps a reference to them to keep - them from getting garbage collected. Simply pass each such value - to this function and a reference will be held to it for the life - of the app. - */ - capi.sqlite3_vfs_register.addReference = function f(...args){ - if(!f._) f._ = []; - f._.push(...args); - }; - }/*xWrap() bindings*/; + /** + When registering a VFS and its related components it may be + necessary to ensure that JS keeps a reference to them to keep + them from getting garbage collected. Simply pass each such value + to this function and a reference will be held to it for the life + of the app. + */ + capi.sqlite3_vfs_register.addReference = function f(...args){ + if(!f._) f._ = []; + f._.push(...args); + }; + /** Internal helper to assist in validating call argument counts in the hand-written sqlite3_xyz() wrappers. We do this only for diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js index 96b2fa019d..05305db22a 100644 --- a/ext/wasm/api/sqlite3-api-prologue.js +++ b/ext/wasm/api/sqlite3-api-prologue.js @@ -1042,25 +1042,24 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap( //set: wasm.exports.sqlite3_wasm_pstack_restore }, /** - Resolves to the total number of bytes available in the pstack, - including any space which is currently allocated. This value is - a compile-time constant. + sqlite3.wasm.pstack.quota to the total number of bytes + available in the pstack, including any space which is currently + allocated. This value is a compile-time constant. */ quota: { configurable: false, iterable: true, writeable: false, get: wasm.exports.sqlite3_wasm_pstack_quota - } + }, + /** + sqlite3.wasm.pstack.remaining resolves to the amount of space + remaining in the pstack. + */ + remaining: { + configurable: false, iterable: true, writeable: false, + get: wasm.exports.sqlite3_wasm_pstack_remaining + } })/*wasm.pstack properties*/; - /** - sqlite3.wasm.pstack.remaining resolves to the amount of - space remaining in the pstack. - */ - Object.defineProperty(wasm.pstack, 'remaining', { - configurable: false, iterable: true, writeable: false, - get: wasm.exports.sqlite3_wasm_pstack_remaining - }); - /** An Error subclass specifically for reporting DB-level errors and enabling clients to unambiguously identify such exceptions. diff --git a/ext/wasm/common/SqliteTestUtil.js b/ext/wasm/common/SqliteTestUtil.js index 08688fd487..5ed423785b 100644 --- a/ext/wasm/common/SqliteTestUtil.js +++ b/ext/wasm/common/SqliteTestUtil.js @@ -172,13 +172,9 @@ ], //onRuntimeInitialized: function(){}, /* Proxy for C-side stdout output. */ - print: function(){ - console.log.apply(console, Array.prototype.slice.call(arguments)); - }, + print: (...args)=>{console.log(...args)}, /* Proxy for C-side stderr output. */ - printErr: function(){ - console.error.apply(console, Array.prototype.slice.call(arguments)); - }, + printErr: (...args)=>{console.error(...args)}, /** Called by the Emscripten module init bits to report loading progress. It gets passed an empty argument when loading is done diff --git a/ext/wasm/index.html b/ext/wasm/index.html index 7df2c601f5..044cd1360d 100644 --- a/ext/wasm/index.html +++ b/ext/wasm/index.html @@ -82,6 +82,9 @@
sqlite3.capi.wasm
sqlite3.capi.wasm.pstack
sqlite3
Namespace
+ The sqlite3
namespace object exposes the following...
+
sqlite3.version
+ The sqlite3.version
object exposes the following...
+
sqlite3_...()
Function ListThe sqlite3.capi
object exposes the following
+ sqlite3_...()
+ functions...
+
+ = function is specific to the JS/WASM
+ bindings, not part of the C API.
+
SQLITE_...
ConstantsThe sqlite3.capi
object exposes the following
+ SQLITE_...
+ constants...
+
sqlite3.oo1
+ The sqlite3.oo1
object exposes the following...
+
sqlite3.capi.wasm
+ The sqlite3.capi.wasm
object exposes the
+ following...
+
sqlite3.capi.wasm.pstack
+ The sqlite3.capi.wasm.pstack
object exposes the
+ following...
+
+ Compilation options used in this build of sqlite3.wasm
...
+