aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-opfs.js
diff options
context:
space:
mode:
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 86285df1d..3cb5c8a3e 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 =
+#ifdef 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
@@ -566,7 +571,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("");
};
/**
@@ -1155,7 +1160,7 @@ const installOpfsVfs = function callee(options){
be set here.
*/
//"pragma cache_size=-8388608;"
- ].join('')
+ ].join("")
);
}