aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-11-19 02:58:03 +0000
committerstephan <stephan@noemail.net>2022-11-19 02:58:03 +0000
commitc768ef7289c747b5f487319503d9150ef97bfc13 (patch)
tree69f45352000825e21c5ae74400e601e0ff6b3325 /ext/wasm/api/sqlite3-api-opfs.js
parent85728a21c63e8feb1c13d2cf81962bd34b023a08 (diff)
parentf7d98ac7649f6b0ad5cd0597e02e0fd96df437dc (diff)
downloadsqlite-c768ef7289c747b5f487319503d9150ef97bfc13.tar.gz
sqlite-c768ef7289c747b5f487319503d9150ef97bfc13.zip
Integrate a custom preprocessor to the JS build process to facilitate creation of both vanilla JS and ES6 Module builds from the same source files. There is still some build-level reworking pending to make an ESM build a first-class deliverable.
FossilOrigin-Name: 10c723d96d61d2e552ec1102563d58f1eb11bc3d30e03606fd8e0279c5a9043a
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r--ext/wasm/api/sqlite3-api-opfs.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js
index da5496f65..e35eed64d 100644
--- a/ext/wasm/api/sqlite3-api-opfs.js
+++ b/ext/wasm/api/sqlite3-api-opfs.js
@@ -166,7 +166,12 @@ const installOpfsVfs = function callee(options){
opfsVfs.dispose();
return promiseReject_(err);
};
- const W = new Worker(options.proxyUri);
+ const W =
+//#if SQLITE_JS_ESM
+ new Worker(new URL(options.proxyUri, import.meta.url));
+//#else
+ new Worker(options.proxyUri);
+//#endif
W._originalOnError = W.onerror /* will be restored later */;
W.onerror = function(err){
// The error object doesn't contain any useful info when the
@@ -569,7 +574,7 @@ const installOpfsVfs = function callee(options){
const ndx = Math.random() * (f._n * 64) % f._n | 0;
a[i] = f._chars[ndx];
}
- return a.join('');
+ return a.join("");
};
/**
@@ -1158,7 +1163,7 @@ const installOpfsVfs = function callee(options){
be set here.
*/
//"pragma cache_size=-8388608;"
- ].join('')
+ ].join("")
);
}