require 'util' instead of 'sys'

This commit is contained in:
brianc 2011-10-10 19:40:52 -05:00
parent afe4382c63
commit 06585d6e2c
10 changed files with 16 additions and 18 deletions

View File

@ -1,6 +1,6 @@
var sys = require('sys');
var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var Query = require(__dirname + '/query');
var utils = require(__dirname + '/utils');
@ -24,7 +24,7 @@ var Client = function(config) {
var self = this;
};
sys.inherits(Client, EventEmitter);
util.inherits(Client, EventEmitter);
var p = Client.prototype;

View File

@ -1,7 +1,7 @@
var sys = require('sys');
var net = require('net');
var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var utils = require(__dirname + '/utils');
var Writer = require(__dirname + '/writer');
@ -19,7 +19,7 @@ var Connection = function(config) {
this.writer = new Writer();
};
sys.inherits(Connection, EventEmitter);
util.inherits(Connection, EventEmitter);
var p = Connection.prototype;
@ -313,7 +313,7 @@ p.parseR = function(msg) {
return msg;
}
}
throw new Error("Unknown authenticatinOk message type" + sys.inspect(msg));
throw new Error("Unknown authenticatinOk message type" + util.inspect(msg));
};
p.parseS = function(msg) {

View File

@ -1,6 +1,5 @@
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var util = require('util');
var Client = require(__dirname+'/client');
var defaults = require(__dirname + '/defaults');
@ -17,7 +16,7 @@ var PG = function(clientConstructor) {
this.defaults = defaults;
};
sys.inherits(PG, EventEmitter);
util.inherits(PG, EventEmitter);
PG.prototype.end = function() {
Object.keys(pools).forEach(function(name) {

View File

@ -1,5 +1,4 @@
//require the c++ bindings & export to javascript
var sys = require('sys');
var EventEmitter = require('events').EventEmitter;
var utils = require(__dirname + "/../utils");

View File

@ -1,5 +1,5 @@
var sys = require('sys');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var types = require(__dirname + "/../types");
@ -52,7 +52,7 @@ var NativeQuery = function(text, values, callback) {
EventEmitter.call(this);
};
sys.inherits(NativeQuery, EventEmitter);
util.inherits(NativeQuery, EventEmitter);
var p = NativeQuery.prototype;
//maps from native rowdata into api compatible row object

View File

@ -1,5 +1,6 @@
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');var sys = require('sys');
var util = require('util');
var Result = require(__dirname + "/result");
var types = require(__dirname + "/types");
@ -19,7 +20,7 @@ var Query = function(config) {
EventEmitter.call(this);
};
sys.inherits(Query, EventEmitter);
util.inherits(Query, EventEmitter);
var p = Query.prototype;
p.requiresPreparation = function() {

View File

@ -1,7 +1,6 @@
var url = require('url');
var defaults = require(__dirname + "/defaults");
var events = require('events');
var sys = require('sys');
//compatibility for old nodes
if(typeof events.EventEmitter.prototype.once !== 'function') {

View File

@ -1,4 +1,4 @@
var sys = require('sys');
var sys = require('utils');
var args = require(__dirname + '/../test/cli');
var pg = require(__dirname + '/../lib');

View File

@ -1,10 +1,10 @@
var helper = require(__dirname + '/test-helper');
var sys = require('sys');
var util = require('util');
var createErorrClient = function() {
var client = helper.client();
client.on('error', function(err) {
assert.ok(false, "client should not throw query error: " + sys.inspect(err));
assert.ok(false, "client should not throw query error: " + util.inspect(err));
});
client.on('drain', client.end.bind(client));
return client;

View File

@ -2,7 +2,7 @@
assert = require('assert');
var EventEmitter = require('events').EventEmitter;
var sys = require('sys');
var sys = require('util');
var BufferList = require(__dirname+'/buffer-list')
var Connection = require(__dirname + '/../lib/connection');