diff options
author | stephan <stephan@noemail.net> | 2023-11-22 17:11:39 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-11-22 17:11:39 +0000 |
commit | c0314bc01d25830031a8a925d682035066a993ed (patch) | |
tree | 31cb8f3c3e2173544c29256dd283bd85826cd702 /ext/wasm/api | |
parent | d9f3d6d75340407dda404237520d4a571695a665 (diff) | |
download | sqlite-c0314bc01d25830031a8a925d682035066a993ed.tar.gz sqlite-c0314bc01d25830031a8a925d682035066a993ed.zip |
Correct the URL for loading sqlite3-worker1-bundler-friendly.mjs from sqlite3-worker1-promiser-bundler-friendly.js, so that the promiser can be used in bundler-using environments. Problem reported via email.
FossilOrigin-Name: 753a75218913c3b9c7ec5438387107369c34d1775d68b04d19ae18197e558605
Diffstat (limited to 'ext/wasm/api')
-rw-r--r-- | ext/wasm/api/sqlite3-worker1-promiser.c-pp.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js b/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js index bad599673..1f88b713a 100644 --- a/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js +++ b/ext/wasm/api/sqlite3-worker1-promiser.c-pp.js @@ -247,9 +247,8 @@ globalThis.sqlite3Worker1Promiser = function callee(config = callee.defaultConfi globalThis.sqlite3Worker1Promiser.defaultConfig = { worker: function(){ //#if target=es6-bundler-friendly - return new Worker("sqlite3-worker1-bundler-friendly.mjs",{ - type: 'module' /* Noting that neither Firefox nor Safari suppor this, - as of this writing. */ + return new Worker(new URL("sqlite3-worker1-bundler-friendly.mjs", import.meta.url),{ + type: 'module' }); //#else let theJs = "sqlite3-worker1.js"; @@ -267,8 +266,12 @@ globalThis.sqlite3Worker1Promiser.defaultConfig = { } return new Worker(theJs + globalThis.location.search); //#endif - }.bind({ + } +//#ifnot target=es6-bundler-friendly + .bind({ currentScript: globalThis?.document?.currentScript - }), + }) +//#endif + , onerror: (...args)=>console.error('worker1 promiser error',...args) }; |