Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with .prototype = new EventEmitter #3

Open
AlexeyKupershtokh opened this issue Apr 9, 2013 · 2 comments
Open

Possible issue with .prototype = new EventEmitter #3

AlexeyKupershtokh opened this issue Apr 9, 2013 · 2 comments

Comments

@AlexeyKupershtokh
Copy link

I've seen you do

zmqstream.Socket.super_ = EventEmitter
zmqstream.Socket.prototype.__proto__ = new EventEmitter()

in the lib/zmqstream.js

There were a recent bug with a similar situation: nodejs/node-v0.x-archive#4971
So you may want to check if it's applicable to zmq-stream as well.

@Schoonology
Copy link
Owner

We should be okay because we do call super_ during construction. That said, I haven't been able to test it yet, so I'm leaving this issue open.

Thanks for the find!

@AlexeyKupershtokh
Copy link
Author

Yep, it's reproduced in node 0.10.3:

var zmqstream = require('../lib/zmqstream')
var a = new zmqstream.Socket({ type: zmqstream.Type.ROUTER });
var b = new zmqstream.Socket({ type: zmqstream.Type.ROUTER });
a.on('x', function(){ console.log('X'); });
b.emit('x');

outputs "X"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants