1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Improve how sqlite3.initWorker1API() determines whether it's running in a Worker thread. Based on feedback in [forum:ac7a94d4f77db235|forum post ac7a94d4f77db235].

FossilOrigin-Name: 2f712b836a0dafd0b2ee6ba4eaa9caa35e49375c7ad0562477e0f2d3b086ec03
This commit is contained in:
stephan
2023-03-07 19:23:36 +00:00
parent 4214cc32ba
commit 416e9c1908
3 changed files with 8 additions and 8 deletions

View File

@@ -317,7 +317,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
sqlite3.initWorker1API = function(){
'use strict';
const toss = (...args)=>{throw new Error(args.join(' '))};
if('function' !== typeof importScripts){
if(!(globalThis.WorkerGlobalScope instanceof Function)){
toss("initWorker1API() must be run from a Worker thread.");
}
const self = this.self;