@@ -641,7 +641,7 @@ bool njsConnection::ProcessExecuteBinds(Local<Object> binds, njsBaton *baton)
641
641
642
642
// determine bind names (if binding by name)
643
643
baton->bindArraySize = 1 ;
644
- if (!binds->IsArray ())
644
+ if (!binds->IsUndefined () && !binds-> IsArray ())
645
645
bindNames = binds->GetOwnPropertyNames ();
646
646
647
647
// initialize variables; if there are no variables, nothing further to do!
@@ -863,7 +863,7 @@ bool njsConnection::ProcessExecuteManyBinds(Local<Array> binds,
863
863
// the number of bind variables and types
864
864
if (scanRequired)
865
865
bindDefs = Nan::Get (binds, 0 ).ToLocalChecked ();
866
- if (!bindDefs->IsArray ())
866
+ if (!bindDefs->IsUndefined () && !bindDefs-> IsArray ())
867
867
bindNames = bindDefs.As <Object>()->GetOwnPropertyNames ();
868
868
869
869
// initialize variables; if there are no variables, nothing further to do!
@@ -1034,12 +1034,11 @@ bool njsConnection::InitBindVars(Local<Object> bindObj,
1034
1034
1035
1035
// create bind variables (one for each element of the bind array or each
1036
1036
// property of the bind object)
1037
- if (byPosition)
1037
+ if (bindObj->IsUndefined ())
1038
+ baton->numBindVars = 0 ;
1039
+ else if (byPosition)
1038
1040
baton->numBindVars = bindObj.As <Array>()->Length ();
1039
- else {
1040
- bindNames = bindObj->GetOwnPropertyNames ();
1041
- baton->numBindVars = bindNames->Length ();
1042
- }
1041
+ else baton->numBindVars = bindNames->Length ();
1043
1042
baton->bindVars = new njsVariable[baton->numBindVars ];
1044
1043
1045
1044
// initialize bind variables (set position or name)
0 commit comments