Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minot errors.

  • Loading branch information...
commit 6886d2cea52227061eed4002a681342aa8b4944f 1 parent cd8d2b8
René Kijewski authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/mysql-pool/pool.js
9 lib/mysql-pool/pool.js
View
@@ -111,12 +111,15 @@ MySQLPool.prototype._forEach = function _forEach(params) {
// TODO: callback _once_
var pool = this;
var args = Array.prototype.slice.call(params.args);
+ while(typeof args[args.length-1] == "undefined") {
+ args.pop();
+ }
var cb = args.pop();
function mkCallback(client) {
return function(err) {
- if(params.cb) {
- cb.apply(client, arguments);
+ if(cb) {
+ cb.apply(client, Array.prototype.slice.call(arguments));
} else if(err) {
pool.emit("error", err);
}
@@ -125,7 +128,7 @@ MySQLPool.prototype._forEach = function _forEach(params) {
for(var i in this._connectionPool) {
var client = this._connectionPool[i];
- params.method.apply(client, params.args.concat(mkCallback(client)));
+ params.method.apply(client, args.concat(mkCallback(client)));
}
if(params.destroying) {
Please sign in to comment.
Something went wrong with that request. Please try again.