mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Correct the result code from kvstorageRead() for the OOM case to be a negative value.
FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c
This commit is contained in:
@ -641,7 +641,7 @@ EM_JS(int, kvstorageRead,
|
||||
const stack = stackSave();
|
||||
try {
|
||||
const zXKey = kvstorageMakeKeyOnJSStack(zClass,zKey);
|
||||
if(!zXKey) return 1/*OOM*/;
|
||||
if(!zXKey) return -3/*OOM*/;
|
||||
const jKey = UTF8ToString(zXKey);
|
||||
const jV = ((115/*=='s'*/===getValue(zClass))
|
||||
? sessionStorage : localStorage).getItem(jKey);
|
||||
@ -661,7 +661,7 @@ EM_JS(int, kvstorageRead,
|
||||
return nBuf - 1;
|
||||
}catch(e){
|
||||
console.error("kvstorageRead()",e);
|
||||
return -1;
|
||||
return -2;
|
||||
}finally{
|
||||
stackRestore(stack);
|
||||
}
|
||||
|
Reference in New Issue
Block a user