Skip to content

Commit 3f9e99a

Browse files
committed
Small type annotation improvements
1 parent 654f8df commit 3f9e99a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/api.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
222222
*
223223
* @constructs Statement
224224
* @memberof module:SqlJs
225+
* @param {number} stmt1 The SQLite statement reference
226+
* @param {Database} db The database from which this statement was created
225227
*/
226228
function Statement(stmt1, db) {
227229
this.stmt = stmt1;
@@ -303,7 +305,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
303305
case SQLITE_DONE:
304306
return false;
305307
default:
306-
return this.db.handleError(ret);
308+
throw this.db.handleError(ret);
307309
}
308310
};
309311

@@ -554,8 +556,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
554556
@nodoc
555557
*/
556558
Statement.prototype.bindFromObject = function bindFromObject(valuesObj) {
557-
var that;
558-
that = this;
559+
var that = this;
559560
Object.keys(valuesObj).forEach(function each(name) {
560561
var num;
561562
num = sqlite3_bind_parameter_index(that.stmt, name);
@@ -567,7 +568,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
567568
};
568569

569570
/** Bind values to numbered parameters
570-
@param {Database.SqlValue[]} valuesObj
571+
@param {Database.SqlValue[]} values
571572
@private
572573
@nodoc
573574
*/
@@ -789,16 +790,15 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
789790

790791
/** Execute an sql statement, and call a callback for each row of result.
791792
792-
**Currently** this method is synchronous, it will not return until the
793-
callback has been called on every row of the result. But this might change.
793+
Currently this method is synchronous, it will not return until the callback
794+
has been called on every row of the result. But this might change.
794795
795796
@param {string} sql A string of SQL text. Can contain placeholders
796797
that will be bound to the parameters given as the second argument
797-
@param {Array<Database.SqlValue>} [params] Parameters to bind to the query
798-
@param {function({Object}):void} callback A function that will be called on
799-
each row of result
800-
@param {function()} done A function that will be called when all rows have
801-
been retrieved
798+
@param {Statement.BindParams} [params=[]] Parameters to bind to the query
799+
@param {function(Object<string, Database.SqlValue>):void} callback
800+
Function to call on each row of result
801+
@param {function():void} done A function that will be called when all rows have been retrieved
802802
803803
@return {Database} The database object. Useful for method chaining
804804

0 commit comments

Comments
 (0)