1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

wasm: DB.wrapHandle() no longer accepts a DB object as its first argument, as there's no apparent use case for proxying one DB object with another. Doc improvements for the new code.

FossilOrigin-Name: 0ee19db02a9b9320681d4393d9ba52889d149eac8ee114fc7b7f52a57271c139
This commit is contained in:
stephan
2025-07-09 13:43:53 +00:00
parent 6276637075
commit 2ba5a93e8f
4 changed files with 63 additions and 77 deletions

View File

@ -221,7 +221,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
else if(filter instanceof Function) pass = filter(err);
else if('string' === typeof filter) pass = (err.message === filter);
if(!pass){
throw new Error(msg || ("Filter rejected this exception: "+err.message));
throw new Error(msg || ("Filter rejected this exception: <<"+err.message+">>"));
}
return this;
},
@ -1219,7 +1219,10 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
function do not interfere with downstream tests, e.g. by
closing this.db.pointer. */
//sqlite3.config.debug("Proxying",this.db);
let dw = sqlite3.oo1.DB.wrapHandle(this.db);
const misuseMsg = "SQLITE_MISUSE: Argument must be a WASM sqlite3 pointer";
T.mustThrowMatching(()=>sqlite3.oo1.DB.wrapHandle(this.db), misuseMsg)
.mustThrowMatching(()=>sqlite3.oo1.DB.wrapHandle(0), misuseMsg);
let dw = sqlite3.oo1.DB.wrapHandle(this.db.pointer);
//sqlite3.config.debug('dw',dw);
T.assert( dw, '!!dw' )
.assert( dw instanceof sqlite3.oo1.DB, 'dw is-a oo1.DB' )