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.
|
// non-global reference, for speed.
|
||||||
var PROCESS;
|
var PROCESS;
|
||||||
|
|
||||||
EventEmitter.prototype.emit = function() {
|
EventEmitter.prototype.emit = function(type) {
|
||||||
var type = arguments[0];
|
|
||||||
// If there is no 'error' event listener then throw.
|
// If there is no 'error' event listener then throw.
|
||||||
if (type === 'error') {
|
if (type === 'error') {
|
||||||
if (!this._events || !this._events.error ||
|
if (!this._events || !this._events.error ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user