diff options
author | stephan <stephan@noemail.net> | 2022-08-10 13:22:44 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-08-10 13:22:44 +0000 |
commit | 2315e834632fcdc9f0be844b7ef379a8fe704ab7 (patch) | |
tree | ef83be003bbff85a3bd1df5935b38dbc3f072f73 /ext/wasm/api/sqlite3-api-opfs.js | |
parent | 3961b2636329819f16b1f32739274f3a1d3273de (diff) | |
download | sqlite-2315e834632fcdc9f0be844b7ef379a8fe704ab7.tar.gz sqlite-2315e834632fcdc9f0be844b7ef379a8fe704ab7.zip |
wasm opfs: error handling fix for an impossible-to-reach error case. Minor cosmetic tweaks in the wasm JSON enum.
FossilOrigin-Name: 683a3b937e608a5ecaf7f63f054e8a63179d67c8b2348bf843e5e68f27a369f5
Diffstat (limited to 'ext/wasm/api/sqlite3-api-opfs.js')
-rw-r--r-- | ext/wasm/api/sqlite3-api-opfs.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-api-opfs.js b/ext/wasm/api/sqlite3-api-opfs.js index a04029e30..5a0af2641 100644 --- a/ext/wasm/api/sqlite3-api-opfs.js +++ b/ext/wasm/api/sqlite3-api-opfs.js @@ -32,7 +32,8 @@ // FileSystemFileHandle // FileSystemFileHandle.prototype.createSyncAccessHandle self.sqlite3.postInit.push(function(self, sqlite3){ - const warn = console.warn.bind(console); + const warn = console.warn.bind(console), + error = console.error.bind(console); if(!self.importScripts || !self.FileSystemFileHandle || !self.FileSystemFileHandle.prototype.createSyncAccessHandle){ warn("OPFS not found or its sync API is not available in this environment."); @@ -44,7 +45,6 @@ self.sqlite3.postInit.push(function(self, sqlite3){ //warn('self.FileSystemFileHandle =',self.FileSystemFileHandle); //warn('self.FileSystemFileHandle.prototype =',self.FileSystemFileHandle.prototype); const toss = (...args)=>{throw new Error(args.join(' '))}; - /* This is a web worker, so init the worker-based API. */ const capi = sqlite3.capi, wasm = capi.wasm; const sqlite3_vfs = capi.sqlite3_vfs @@ -54,8 +54,7 @@ self.sqlite3.postInit.push(function(self, sqlite3){ const sqlite3_io_methods = capi.sqlite3_io_methods || toss("Missing sqlite3.capi.sqlite3_io_methods object."); const StructBinder = sqlite3.StructBinder || toss("Missing sqlite3.StructBinder."); - const error = console.error.bind(console), - debug = console.debug.bind(console), + const debug = console.debug.bind(console), log = console.log.bind(console); warn("UNDER CONSTRUCTION: setting up OPFS VFS..."); |