aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-worker1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-09-19 03:57:31 +0000
committerstephan <stephan@noemail.net>2022-09-19 03:57:31 +0000
commitac51eb77546653a6e0563adc0f3460ae69744485 (patch)
tree836b4fcb767aa5e03ffd57decef3e3b2aeb1bd8a /ext/wasm/api/sqlite3-api-worker1.js
parented85333977d5d2f5ce36ba2b04a9729fabad73bb (diff)
downloadsqlite-ac51eb77546653a6e0563adc0f3460ae69744485.tar.gz
sqlite-ac51eb77546653a6e0563adc0f3460ae69744485.zip
Rename demo-oo1.* to demo-123.* and add demo-123-worker.html, which runs the same demo via a Worker. Doc typo fixes.
FossilOrigin-Name: 2e4a005bd35424caeaa99ace23162cf79e2ebdb159475ffad92b85dc864ad764
Diffstat (limited to 'ext/wasm/api/sqlite3-api-worker1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-worker1.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-api-worker1.js b/ext/wasm/api/sqlite3-api-worker1.js
index 97f2677e6..b41a837e9 100644
--- a/ext/wasm/api/sqlite3-api-worker1.js
+++ b/ext/wasm/api/sqlite3-api-worker1.js
@@ -326,13 +326,12 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
sqlite3.initWorker1API = function(){
'use strict';
const toss = (...args)=>{throw new Error(args.join(' '))};
- if('function' !== typeof importScripts){
- toss("Cannot initalize the sqlite3 worker API in the main thread.");
+ if(self.window === self || 'function' !== typeof importScripts){
+ toss("initWorker1API() must be run from a Worker thread.");
}
const self = this.self;
const sqlite3 = this.sqlite3 || toss("Missing this.sqlite3 object.");
- const SQLite3 = sqlite3.oo1 || toss("Missing this.sqlite3.oo1 OO API.");
- const DB = SQLite3.DB;
+ const DB = sqlite3.oo1.DB;
/**
Returns the app-wide unique ID for the given db, creating one if