mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Remove legacy .once events shim
This commit is contained in:
parent
981b4345f0
commit
0565ed6c05
12
lib/utils.js
12
lib/utils.js
@ -1,17 +1,5 @@
|
||||
var url = require('url');
|
||||
var defaults = require(__dirname + "/defaults");
|
||||
var events = require('events');
|
||||
|
||||
//compatibility for old nodes
|
||||
if(typeof events.EventEmitter.prototype.once !== 'function') {
|
||||
events.EventEmitter.prototype.once = function (type, listener) {
|
||||
var self = this;
|
||||
self.on(type, function g () {
|
||||
self.removeListener(type, g);
|
||||
listener.apply(this, arguments);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
// convert a JS array to a postgres array literal
|
||||
// uses comma separator so won't work for types like box that use
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user