shipharbor / merry

:ocean::ocean::sailboat::ocean::ocean: - cute streaming API framework
MIT License
312 stars 21 forks source link

“info” undefined within `onlisten` #86

Closed jondashkyle closed 7 years ago

jondashkyle commented 7 years ago

getting this lil error:

TypeError: Cannot read property 'info' of undefined
at Server.Merry.onlisten (../node_modules/merry/index.js:74:11)

this appears to be because the context of this within onlisten is bound to that of the server.listen call. quick and dirty fix is to add this at line 69:

this.onlisten = this.onlisten.bind(this)
server.listen(this._port, this.onlisten)

unsure if there is an alternate way this should be patched, but a heads up! excited to start using this new version.

lrlna commented 7 years ago

Hey! Thanks for reporting, fixed in 5.0.1 :sparkles: