diff options
author | Ryunosuke SATO <tricknotes.rs@gmail.com> | 2012-12-10 18:07:23 +0900 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-12-10 13:04:46 +0100 |
commit | 1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e (patch) | |
tree | c7244f65a65e2645c6bd454960b0bc47f0d1b166 /lib | |
parent | 0397223ab4a050f4acffeee6952660710327f2a0 (diff) | |
download | android-node-v8-1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e.tar.gz android-node-v8-1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e.tar.bz2 android-node-v8-1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e.zip |
events: use assigned variable instead of arguments
Always `arguments[0]` is used when `EventEmitter#emit` called.
Using assigned variable is faster than `arguments[0]`.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/events.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/events.js b/lib/events.js index fc933c5fd8..00c2071f28 100644 --- a/lib/events.js +++ b/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 || |