mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Merge pull request #562 from tgriesser/remove-once
Remove legacy .once events shim
This commit is contained in:
commit
7442ea9285
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