Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function PooledConnection(connectionPool, config) {
var self = this;
this.connectionPool = connectionPool;
this.isEnded = false;
Connection.call(this, config);
this.on('end', function () {
self.isEnded = true;
self.connectionPool.pool.destroy(self);
});
}