@@ -222,6 +222,8 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
222
222
*
223
223
* @constructs Statement
224
224
* @memberof module:SqlJs
225
+ * @param {number } stmt1 The SQLite statement reference
226
+ * @param {Database } db The database from which this statement was created
225
227
*/
226
228
function Statement ( stmt1 , db ) {
227
229
this . stmt = stmt1 ;
@@ -303,7 +305,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
303
305
case SQLITE_DONE :
304
306
return false ;
305
307
default :
306
- return this . db . handleError ( ret ) ;
308
+ throw this . db . handleError ( ret ) ;
307
309
}
308
310
} ;
309
311
@@ -554,8 +556,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
554
556
@nodoc
555
557
*/
556
558
Statement . prototype . bindFromObject = function bindFromObject ( valuesObj ) {
557
- var that ;
558
- that = this ;
559
+ var that = this ;
559
560
Object . keys ( valuesObj ) . forEach ( function each ( name ) {
560
561
var num ;
561
562
num = sqlite3_bind_parameter_index ( that . stmt , name ) ;
@@ -567,7 +568,7 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
567
568
} ;
568
569
569
570
/** Bind values to numbered parameters
570
- @param {Database.SqlValue[] } valuesObj
571
+ @param {Database.SqlValue[] } values
571
572
@private
572
573
@nodoc
573
574
*/
@@ -789,16 +790,15 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
789
790
790
791
/** Execute an sql statement, and call a callback for each row of result.
791
792
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.
794
795
795
796
@param {string } sql A string of SQL text. Can contain placeholders
796
797
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
802
802
803
803
@return {Database } The database object. Useful for method chaining
804
804
0 commit comments