mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Minor internal cleanups in the js pieces.
FossilOrigin-Name: 271391b4e32220ab4c32d69f579ecd2b03eb99da898955a1ef8fffc27216719d
This commit is contained in:
@ -401,11 +401,11 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
break;
|
||||
case undefined:
|
||||
case 'this':
|
||||
out.returnVal = ()=>db;
|
||||
break;
|
||||
default:
|
||||
toss3("Invalid returnValue value:",opt.returnValue);
|
||||
}
|
||||
if(!out.returnVal) out.returnVal = ()=>db;
|
||||
if(opt.callback || opt.resultRows){
|
||||
switch((undefined===opt.rowMode)
|
||||
? 'array' : opt.rowMode) {
|
||||
@ -762,15 +762,12 @@ self.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
affirmDbOpen(this);
|
||||
const arg = parseExecArgs(this, arguments);
|
||||
if(!arg.sql){
|
||||
return (''===arg.sql) ? this : toss3("exec() requires an SQL string.");
|
||||
return toss3("exec() requires an SQL string.");
|
||||
}
|
||||
const opt = arg.opt;
|
||||
const callback = opt.callback;
|
||||
const returnValue = opt.returnValue || 'this';
|
||||
const resultRows = (Array.isArray(opt.resultRows)
|
||||
? opt.resultRows : (
|
||||
'resultRows'===returnValue ? [] : undefined
|
||||
));
|
||||
const resultRows =
|
||||
Array.isArray(opt.resultRows) ? opt.resultRows : undefined;
|
||||
let stmt;
|
||||
let bind = opt.bind;
|
||||
let evalFirstResult = !!(arg.cbArg || opt.columnNames) /* true to evaluate the first result-returning query */;
|
||||
|
Reference in New Issue
Block a user