aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyunosuke SATO <tricknotes.rs@gmail.com>2012-12-10 18:07:23 +0900
committerBen Noordhuis <info@bnoordhuis.nl>2012-12-10 13:04:46 +0100
commit1c7acd2c843d9f19a0b8ecee48ec48fa617eac5e (patch)
treec7244f65a65e2645c6bd454960b0bc47f0d1b166 /lib
parent0397223ab4a050f4acffeee6952660710327f2a0 (diff)
downloadandroid-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.js3
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 ||