Merge pull request #562 from tgriesser/remove-once

Remove legacy .once events shim
This commit is contained in:
Brian C 2014-04-08 22:17:52 -05:00
commit 7442ea9285

View File

@ -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