aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-glue.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-12-09 09:23:27 +0000
committerstephan <stephan@noemail.net>2022-12-09 09:23:27 +0000
commit81a368317456d9c1500e33949b214185e1e0b565 (patch)
treed3aaca84ccaf8cbb63b47e5ef5444d5f921e2dd0 /ext/wasm/api/sqlite3-api-glue.js
parent5a83f52f4881aa461ee3b7132892fddb8e20c9b2 (diff)
downloadsqlite-81a368317456d9c1500e33949b214185e1e0b565.tar.gz
sqlite-81a368317456d9c1500e33949b214185e1e0b565.zip
Rename the oft-used, verbose sqlite3.wasm.get/setMemValue() and get/setPtrValue() to peek/poke() and peek/pokePtr(). The old names are retained as aliases just in case any client code actually uses them, but they are now deprecated.
FossilOrigin-Name: ad0a8139b0b025f8e9d2eca0c303557ef10fdfab8c8b65afb08c510a804073d5
Diffstat (limited to 'ext/wasm/api/sqlite3-api-glue.js')
-rw-r--r--ext/wasm/api/sqlite3-api-glue.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/wasm/api/sqlite3-api-glue.js b/ext/wasm/api/sqlite3-api-glue.js
index b95f15e71..80438e086 100644
--- a/ext/wasm/api/sqlite3-api-glue.js
+++ b/ext/wasm/api/sqlite3-api-glue.js
@@ -197,8 +197,8 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
try {
let aVals = [], aNames = [], i = 0, offset = 0;
for( ; i < nCols; offset += (wasm.ptrSizeof * ++i) ){
- aVals.push( wasm.cstrToJs(wasm.getPtrValue(pColVals + offset)) );
- aNames.push( wasm.cstrToJs(wasm.getPtrValue(pColNames + offset)) );
+ aVals.push( wasm.cstrToJs(wasm.peekPtr(pColVals + offset)) );
+ aNames.push( wasm.cstrToJs(wasm.peekPtr(pColNames + offset)) );
}
rc = callback(pVoid, nCols, aVals, aNames) | 0;
/* The first 2 args of the callback are useless for JS but
@@ -294,7 +294,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
let i, pVal, valType, arg;
const tgt = [];
for(i = 0; i < argc; ++i){
- pVal = wasm.getPtrValue(pArgv + (wasm.ptrSizeof * i));
+ pVal = wasm.peekPtr(pArgv + (wasm.ptrSizeof * i));
/**
Curiously: despite ostensibly requiring 8-byte
alignment, the pArgv array is parcelled into chunks of
@@ -693,7 +693,7 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
pstack = wasm.pstack;
const kvvfsStorage = (zClass)=>
- ((115/*=='s'*/===wasm.getMemValue(zClass))
+ ((115/*=='s'*/===wasm.peek(zClass))
? sessionStorage : localStorage);
/**
@@ -717,13 +717,13 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
C-string's byte length. */;
if(nBuf<=0) return nV;
else if(1===nBuf){
- wasm.setMemValue(zBuf, 0);
+ wasm.poke(zBuf, 0);
return nV;
}
const zV = wasm.scopedAllocCString(jV);
if(nBuf > nV + 1) nBuf = nV + 1;
wasm.heap8u().copyWithin(zBuf, zV, zV + nBuf - 1);
- wasm.setMemValue(zBuf + nBuf - 1, 0);
+ wasm.poke(zBuf + nBuf - 1, 0);
return nBuf - 1;
}catch(e){
console.error("kvstorageRead()",e);