@@ -36,9 +36,7 @@ var Client = function(config) {
3636
3737util . inherits ( Client , EventEmitter ) ;
3838
39- var p = Client . prototype ;
40-
41- p . connect = function ( callback ) {
39+ Client . prototype . connect = function ( callback ) {
4240 var self = this ;
4341 var con = this . connection ;
4442 if ( this . host && this . host . indexOf ( '/' ) === 0 ) {
@@ -170,7 +168,7 @@ p.connect = function(callback) {
170168
171169} ;
172170
173- p . cancel = function ( client , query ) {
171+ Client . prototype . cancel = function ( client , query ) {
174172 if ( client . activeQuery == query ) {
175173 var con = this . connection ;
176174
@@ -190,7 +188,7 @@ p.cancel = function(client, query) {
190188 }
191189} ;
192190
193- p . _pulseQueryQueue = function ( ) {
191+ Client . prototype . _pulseQueryQueue = function ( ) {
194192 if ( this . readyForQuery === true ) {
195193 this . activeQuery = this . queryQueue . shift ( ) ;
196194 if ( this . activeQuery ) {
@@ -204,7 +202,8 @@ p._pulseQueryQueue = function() {
204202 }
205203 }
206204} ;
207- p . _copy = function ( text , stream ) {
205+
206+ Client . prototype . _copy = function ( text , stream ) {
208207 var config = { } ,
209208 query ;
210209 config . text = text ;
@@ -222,13 +221,16 @@ p._copy = function (text, stream) {
222221 return config . stream ;
223222
224223} ;
225- p . copyFrom = function ( text ) {
224+
225+ Client . prototype . copyFrom = function ( text ) {
226226 return this . _copy ( text , new CopyFromStream ( ) ) ;
227227} ;
228- p . copyTo = function ( text ) {
228+
229+ Client . prototype . copyTo = function ( text ) {
229230 return this . _copy ( text , new CopyToStream ( ) ) ;
230231} ;
231- p . query = function ( config , values , callback ) {
232+
233+ Client . prototype . query = function ( config , values , callback ) {
232234 //can take in strings, config object or query object
233235 var query = ( config instanceof Query ) ? config :
234236 new Query ( config , values , callback ) ;
@@ -243,19 +245,19 @@ p.query = function(config, values, callback) {
243245
244246//prevents client from otherwise emitting 'drain' event until 'resumeDrain' is
245247//called
246- p . pauseDrain = function ( ) {
248+ Client . prototype . pauseDrain = function ( ) {
247249 this . _drainPaused = 1 ;
248250} ;
249251
250252//resume raising 'drain' event
251- p . resumeDrain = function ( ) {
253+ Client . prototype . resumeDrain = function ( ) {
252254 if ( this . _drainPaused > 1 ) {
253255 this . emit ( 'drain' ) ;
254256 }
255257 this . _drainPaused = 0 ;
256258} ;
257259
258- p . end = function ( ) {
260+ Client . prototype . end = function ( ) {
259261 this . connection . end ( ) ;
260262} ;
261263
0 commit comments