Permalink
Browse files

Strip "undefined" parameters in tail of calls arguments.

  • Loading branch information...
1 parent 8278f2a commit e4955c4d8199c600cbbef7749a8e3e54a84c3291 @Kijewski committed Mar 10, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/mysql-pool/pool.js
View
@@ -158,14 +158,17 @@ MySQLPool.prototype._populate = function _populate() {
function mkPrototypeMethod(method) {
return function wrapperMethod() {
var args = argumentsArray(arguments);
+ while(typeof args[args.length-1] == "undefined") {
+ args.pop();
+ }
var client = pool._idleQueue.shift();
if(!client) {
pool._todoQueue.push({method:wrapperMethod, args:args});
return pool;
}
- var cb = args.pop()
+ var cb = args.pop();
args.push(function(err) {
pool._avail(client);
if(cb) {

0 comments on commit e4955c4

Please sign in to comment.