aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-prologue.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-23 21:10:49 +0000
committerstephan <stephan@noemail.net>2022-12-23 21:10:49 +0000
commitab9c2d571e5927060c65d7bfd3132348f6240159 (patch)
tree7d3826617a42d79d14be1d32ed6cbf1a4135927a /ext/wasm/api/sqlite3-api-prologue.js
parent3705f38ab0a22187fd019e431c280cb82eca1165 (diff)
downloadsqlite-ab9c2d571e5927060c65d7bfd3132348f6240159.tar.gz
sqlite-ab9c2d571e5927060c65d7bfd3132348f6240159.zip
Internal JS cleanups. Correct part of [ac136925a645] to account for the eTextRep flag being able to hold flags other than the encoding.
FossilOrigin-Name: 1dfc03ab1e0269807beef27bf884ab9ead7553d4a5f6ed213f812d7fa052045f
Diffstat (limited to 'ext/wasm/api/sqlite3-api-prologue.js')
-rw-r--r--ext/wasm/api/sqlite3-api-prologue.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/wasm/api/sqlite3-api-prologue.js b/ext/wasm/api/sqlite3-api-prologue.js
index 94514e477..6c50e99b0 100644
--- a/ext/wasm/api/sqlite3-api-prologue.js
+++ b/ext/wasm/api/sqlite3-api-prologue.js
@@ -425,7 +425,9 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
any encoding other than sqlite3.SQLITE_UTF8. The JS API does not
currently support any other encoding and likely never
will. This function does not replace that argument on its own
- because it may contain other flags.
+ because it may contain other flags. As a special case, if
+ the bottom 4 bits of that argument are 0, SQLITE_UTF8 is
+ assumed.
2) Any of the four final arguments may be either WASM pointers
(assumed to be function pointers) or JS Functions. In the
@@ -433,6 +435,10 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
sqlite3.capi.wasm.installFunction() and that wrapper is passed
on to the native implementation.
+ For consistency with the C API, it requires the same number of
+ arguments. It returns capi.SQLITE_MISUSE if passed any other
+ argument count.
+
The semantics of JS functions are:
xFunc: is passed `(pCtx, ...values)`. Its return value becomes