Skip to content

Commit b58ae9e

Browse files
committed
clean up prototype shorthand
For some reason a few years ago I thought it would be neat to use a shorthand version of prototype to save myself some keystrokes. That was a cosmetic mistake. It also breaks ctags. Also, normalized some whitespace.
1 parent 8ce808d commit b58ae9e

File tree

9 files changed

+147
-122
lines changed

9 files changed

+147
-122
lines changed

binding.gyp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@
66
'src/binding.cc'
77
],
88
'conditions' : [
9-
['OS=="mac"', {
10-
'include_dirs': ['<!@(pg_config --includedir)'],
11-
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
12-
}],
13-
['OS=="linux"', {
14-
'include_dirs': ['<!@(pg_config --includedir)'],
15-
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
16-
}],
17-
['OS=="solaris"', {
18-
'include_dirs': ['<!@(pg_config --includedir)'],
19-
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
20-
}],
219
['OS=="win"', {
2210
'include_dirs': ['<!@(pg_config --includedir)'],
2311
'libraries' : ['libpq.lib'],
@@ -28,6 +16,9 @@
2816
]
2917
},
3018
}
19+
}, { # OS!="win"
20+
'include_dirs': ['<!@(pg_config --includedir)'],
21+
'libraries' : ['-lpq -L<!@(pg_config --libdir)']
3122
}]
3223
]
3324
}

lib/client.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ var Client = function(config) {
3636

3737
util.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

Comments
 (0)