Roly Fentanes
db8940dae2
`newListener` emits correct fn when using `once`
Fixes #2826 .
13 years ago
Ryunosuke SATO
22d7fe1206
events: fix checking max listeners with `1`
Fixes #2490 .
13 years ago
Siddharth Mahendraker
12cf730b69
events: separate maxListeners and _events
Fixes #1479 .
Fixes #1923 .
13 years ago
Ryan Dahl
4ef8f06fe6
Finally remove node::EventEmitter
14 years ago
Ryan Dahl
91f1b250ec
mraleph emit hack
14 years ago
koichik
80c2fe9456
Fix event listener leak check timing
Fixes #1041 .
14 years ago
Felix Geisendörfer
bc8489580c
Allow to remove all EventEmitter listeners at once
This patch adds support for calling EventEmitter#removeAllListeners
with no parameters in order to remove all listeners as once.
See discussion: https://groups.google.com/forum/#!topic/nodejs-dev/Mcyal1ThTHY
Closes GH-889.
14 years ago
Arnout Kazemier
53bec1c862
Added support for removing .once listeners
Closes GH-806.
14 years ago
Aaron Heckmann
a4dad95be3
EventEmitter#once only takes instanceof function
14 years ago
Ryan Dahl
55048cdf79
Update copyright headers
14 years ago
Ryan Dahl
81d3de7e6d
setMaxListeners should initialize _events
14 years ago
Ryan Dahl
9da75f39d9
Print error when EventEmitters get too many listeners
14 years ago
Daniel C
ca8cc71bd0
EventEmitter.prototype.once should "return this;"
14 years ago
Ryan Dahl
09329cbb04
more lint
14 years ago
Jeremy Martin
144b2a5338
Fix number of args emitted by EventEmitter during "fast case" (lte 3 args)
14 years ago
Peteris Krumins
a6ee3bac85
Add EventEmitter.prototype.once
14 years ago
Micheil Smith
c1aa8ea944
Removed deprecated events.Promise
14 years ago
Joshaven Potter
3d4e4d8909
syntax fixes to pass jslint
14 years ago
isaacs
e9b6b0b327
Report "weird" errors a little better.
There are a few kinds of errors that are very confusing.
1. Errors raised in nextTick
2. Errors emitted on the "error" event
3. RangeErrors that crash the program (or anything without a stack trace)
Long traces will make make these better, of course. In the meantime, this
adds a few handy signposts (in the form of better error reporting and
comments on the otherwise inscrutable code printed to the terminal) that can
help new users find the cause, or at least, ask for help more effectively.
14 years ago
Herbert Vojčík
3e0a8f3ad8
Common subexpression in emit.
14 years ago
Ryan Dahl
6bdc42cee7
shorten some lines in events.js
15 years ago
Ryan Dahl
ae8f8e7258
Optimize emit for two arguments
15 years ago
Ryan Dahl
6961bc568f
More instanceof Array fixes
15 years ago
rick
c9e505791a
use delete for removing events after removing the final listener
15 years ago
Ryan Dahl
515dc2161b
Experimental: 'on' as alias to 'addListener'
15 years ago
Jonas Pfenniger
53a9869ff7
FIX: EventEmitter#removeAllListeners signature
This function should return this is all cases.
15 years ago
Jonas Pfenniger
fea6f829bf
FIX: EventEmitter#removeListener logic
In the case of one defined listener, the function should only remove it
if it is the same as the passed listener.
15 years ago
Ryan Dahl
cee9080381
Fix typos
15 years ago
Ryan Dahl
0633e5cac9
Optimize for few args in EventEmitter.emit
15 years ago
Ryan Dahl
6abdf051d3
Unhandled 'error' events kill program
By default 'error' throws. addListener to prevent this.
15 years ago
isaacs
7ff53f4c6a
Refactor events module to lib/events.js
15 years ago
Ryan Dahl
6befc72f82
Add missing lib/events.js
15 years ago