aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/wasm/api/sqlite3-worker1-promiser.c-pp.js')
-rw-r--r--ext/wasm/api/sqlite3-worker1-promiser.c-pp.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js b/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js
index 0f1ae39ea..86ac279ed 100644
--- a/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js
+++ b/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js
@@ -114,7 +114,7 @@
by all client code except that which tests this API. The `row`
property contains the row result in the form implied by the
`rowMode` option (defaulting to `'array'`). The `rowNumber` is a
- 1-based integer value incremented by 1 on each call into th
+ 1-based integer value incremented by 1 on each call into the
callback.
At the end of the result set, the same event is fired with
@@ -122,6 +122,15 @@
the end of the result set has been reached. Note that the rows
arrive via worker-posted messages, with all the implications
of that.
+
+ Notable shortcomings:
+
+ - This API was not designed with ES6 modules in mind. Neither Firefox
+ nor Safari support, as of March 2023, the {type:"module"} flag to the
+ Worker constructor, so that particular usage is not something we're going
+ to target for the time being:
+
+ https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker
*/
self.sqlite3Worker1Promiser = function callee(config = callee.defaultConfig){
// Inspired by: https://stackoverflow.com/a/52439530
@@ -160,7 +169,7 @@ self.sqlite3Worker1Promiser = function callee(config = callee.defaultConfig){
if(msgHandler && msgHandler.onrow){
msgHandler.onrow(ev);
return;
- }
+ }
if(config.onunhandled) config.onunhandled(arguments[0]);
else err("sqlite3Worker1Promiser() unhandled worker message:",ev);
return;
@@ -239,7 +248,10 @@ self.sqlite3Worker1Promiser = function callee(config = callee.defaultConfig){
self.sqlite3Worker1Promiser.defaultConfig = {
worker: function(){
//#if target=es6-bundler-friendly
- return new Worker("sqlite3-worker1.js");
+ return new Worker("sqlite3-worker1-bundler-friendly.mjs",{
+ type: 'module' /* Noting that neither Firefox nor Safari suppor this,
+ as of this writing. */
+ });
//#else
let theJs = "sqlite3-worker1.js";
if(this.currentScript){