Optimize emit for two arguments
authorRyan Dahl <ry@tinyclouds.org>
Wed, 15 Sep 2010 22:20:04 +0000 (15:20 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 15 Sep 2010 22:20:04 +0000 (15:20 -0700)
lib/events.js

index 6b422d1..69cfc4f 100644 (file)
@@ -21,7 +21,7 @@ process.EventEmitter.prototype.emit = function (type) {
   if (!this._events[type]) return false;
 
   if (typeof this._events[type] == 'function') {
-    if (arguments.length < 3) {
+    if (arguments.length <= 3) {
       // fast case
       this._events[type].call( this
                              , arguments[1]