1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

wasm: change StructBinder signature for sqlite3_file::pMethods from 'P' to 'p' to eliminate an unnecessary and inconsistent level of magic.

FossilOrigin-Name: 85f2e877e53899860af4dc6630044b471a9c7c82faba1f4e1e60ae991460b943
This commit is contained in:
stephan
2022-09-26 11:34:31 +00:00
parent 395012e58e
commit 6a643e4bcd
4 changed files with 12 additions and 15 deletions

View File

@ -503,7 +503,7 @@ const char * sqlite3_wasm_enum_json(void){
#define CurrentStruct sqlite3_file
StructBinder {
M(pMethods,"P");
M(pMethods,"p");
} _StructBinder;
#undef CurrentStruct

View File

@ -717,17 +717,14 @@
//log("sfile",sfile,sfile.constructor.prototype);
T.assert(0===sfile.$pMethods).assert(iom.pointer > 0);
//log("iom",iom);
/** Some of the following tests require that pMethods has a
signature of "P", as opposed to "p". */
sfile.$pMethods = iom;
T.assert(iom === sfile.$pMethods);
sfile.$pMethods = iom.pointer;
T.assert(iom === sfile.$pMethods)
T.assert(iom.pointer === sfile.$pMethods)
.assert(IOM.resolveToInstance(iom))
.assert(undefined ===IOM.resolveToInstance(sfile))
.mustThrow(()=>IOM.resolveToInstance(0,true))
.assert(S3F.resolveToInstance(sfile.pointer))
.assert(undefined===S3F.resolveToInstance(iom));
.assert(undefined===S3F.resolveToInstance(iom))
.assert(iom===IOM.resolveToInstance(sfile.$pMethods));
T.assert(0===iom.$iVersion);
installIOMethods(iom);
T.assert(1===iom.$iVersion);