projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0397223
)
events: use assigned variable instead of arguments
author
Ryunosuke SATO
<tricknotes.rs@gmail.com>
Mon, 10 Dec 2012 09:07:23 +0000
(18:07 +0900)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Mon, 10 Dec 2012 12:04:46 +0000
(13:04 +0100)
Always `arguments[0]` is used when `EventEmitter#emit` called.
Using assigned variable is faster than `arguments[0]`.
lib/events.js
patch
|
blob
|
history
diff --git
a/lib/events.js
b/lib/events.js
index
fc933c5
..
00c2071
100644
(file)
--- 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 ||