Browse Source

events: use assigned variable instead of arguments

Always `arguments[0]` is used when `EventEmitter#emit` called.
Using assigned variable is faster than `arguments[0]`.
v0.9.4-release
Ryunosuke SATO 12 years ago
committed by Ben Noordhuis
parent
commit
1c7acd2c84
  1. 3
      lib/events.js

3
lib/events.js

@ -48,8 +48,7 @@ EventEmitter.prototype.setMaxListeners = function(n) {
// non-global reference, for speed.
var PROCESS;
EventEmitter.prototype.emit = function() {
var type = arguments[0];
EventEmitter.prototype.emit = function(type) {
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events || !this._events.error ||

Loading…
Cancel
Save