node-postgres/lib/utils.js

12 lines
308 B
JavaScript
Raw Normal View History

2010-10-24 01:45:37 +08:00
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);
});
};
}