aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/tester1.c-pp.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-07-09 13:43:53 +0000
committerstephan <stephan@noemail.net>2025-07-09 13:43:53 +0000
commit2ba5a93e8f6f42e617fad7b840d0720bb1dfbe26 (patch)
tree697287c9d9050783f5746dce510707f2b50253b5 /ext/wasm/tester1.c-pp.js
parent6276637075213c3735108d4a9d5a03eeda1e72e5 (diff)
downloadsqlite-2ba5a93e8f6f42e617fad7b840d0720bb1dfbe26.tar.gz
sqlite-2ba5a93e8f6f42e617fad7b840d0720bb1dfbe26.zip
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
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r--ext/wasm/tester1.c-pp.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js
index aafe4d7f3..f2fdeebed 100644
--- a/ext/wasm/tester1.c-pp.js
+++ b/ext/wasm/tester1.c-pp.js
@@ -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' )