hij1nx/EventEmitter2 — pull request #33 by Marsup (2011-10-09 15:39:13+00:00)
Title: Implement multi-level patterns ('**')

Hello hij1nx,

Following a need on Hook.io, I have decided to play a bit with EventEmitter2 and try to implement what's suggested in [this issue](https://github.com/hookio/hook.io/issues/100).

As I'm very lazy I'll just paste the same comment as my commit to explain what it does :)

```
Allow the use of '**' patterns to make matches, this will be better
demonstrated by examples:

- '**' will match everything
- '**.a' will match anything ending with a
- 'a.**' will match anything beginning with a
- '**.a.**' will match anything containing a
- '**.a.**.b.**' will matchin anything with a and b inside and
separated at least by one word
- '**.*' is equivalent to '*.*'
- '*.**' is equivalent to '**' but needs at least 2 words
- '**.**' anywhere in the filter is forbidden and will not be added
```

I have tried to respect your pre-ES5 effort coding style, and I hope the code is understandable.
I haven't really understood what the tests of all.js should do so I've put most of my testings in addListener.js, I hope I haven't missed something important here.
Documentation is not updated as I was unsure you'd integrate it or not.

I'm waiting for your feedback.