node-postgres/lib/utils.js
2010-10-23 12:45:37 -05:00

12 lines
308 B
JavaScript

var events = require('events');
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);
});
};
}