HenrikJoreteg / wildemitter

A super lightweight EventEmitter similar to what comes in Node.js, but with a support for wildcard events '*'
MIT License
213 stars 21 forks source link

Firefox 40+: this.callbacks is undefined #14

Closed fippo closed 9 years ago

fippo commented 9 years ago

i'm getting a

TypeError: this.callbacks is undefined

error in recent simplewebrtc builds when using firefox.

This seems to come from https://github.com/HenrikJoreteg/wildemitter/blob/master/wildemitter.js#L98 but that looks ok?

Unfortunately, when trying to debug this, Firefox crashes.

fippo commented 9 years ago

@HenrikJoreteg @legastero?

fippo commented 9 years ago

ah... the constructor was called too late.

tgabi333 commented 9 years ago

Could you please tell how does it happen?

fippo commented 9 years ago

@tgabi333 see https://github.com/HenrikJoreteg/SimpleWebRTC/commit/da54264b76b9cd59d48bdd3874b281ca2b47e77c -- in some cases the emtiter functionality was used before the constructor was called.

tgabi333 commented 9 years ago

Thanks @fippo, but what cases exactly?