events: use assigned variable instead of arguments
Always `arguments[0]` is used when `EventEmitter#emit` called. Using assigned variable is faster than `arguments[0]`.
This commit is contained in:
parent
0397223ab4
commit
1c7acd2c84
@ -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…
x
Reference in New Issue
Block a user