aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api/sqlite3-api-oo1.js
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2022-11-01 11:09:34 +0000
committerstephan <stephan@noemail.net>2022-11-01 11:09:34 +0000
commit0f32760e3c51975c27801e9f51b995fc1ed07c38 (patch)
treec73e786c993ecf7d6c495f36c33f243df0012b1e /ext/wasm/api/sqlite3-api-oo1.js
parent49048b148eac5f74eb6f1e9dfbd85ee8f95694a4 (diff)
downloadsqlite-0f32760e3c51975c27801e9f51b995fc1ed07c38.tar.gz
sqlite-0f32760e3c51975c27801e9f51b995fc1ed07c38.zip
Minor internal cleanups in the js pieces.
FossilOrigin-Name: 271391b4e32220ab4c32d69f579ecd2b03eb99da898955a1ef8fffc27216719d
Diffstat (limited to 'ext/wasm/api/sqlite3-api-oo1.js')
-rw-r--r--ext/wasm/api/sqlite3-api-oo1.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/wasm/api/sqlite3-api-oo1.js b/ext/wasm/api/sqlite3-api-oo1.js
index aaaeaa3d5..02ce9c0ce 100644
--- a/ext/wasm/api/sqlite3-api-oo1.js
+++ b/ext/wasm/api/sqlite3-api-oo1.js
@@ -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 */;