Fix bug in db.js::statementQuery() that prevented binding a single string parameter without putting it in an array

Also fixed array detection in flattenArguments() to handle a null value
This commit is contained in:
Dan Stillman 2006-09-12 06:53:48 +00:00
parent cc726ef333
commit b84181766d
2 changed files with 2 additions and 2 deletions

View file

@ -172,7 +172,7 @@ Scholar.DB = new function(){
if (statement && params){
// If single parameter, wrap in an array
if (!params.length){
if (typeof params != 'object' || params===null){
params = [params];
}

View file

@ -306,7 +306,7 @@ var Scholar = new function(){
*/
function flattenArguments(args){
// Put passed scalar values into an array
if (typeof args!='object'){
if (typeof args!='object' || args===null){
args = [args];
}