-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Why do you bind ”this“ in event handler #26711
Comments
Mostly because it’s often useful, I assume – it means you don’t have to store the object in another way, and often you can avoid having a closure this way.
Node’s I’d say there’s a chance that |
it’s a best way when you extend |
just to clarify, events emitted by EventTarget also bind |
Seems like not an issue? Closing... |
Would really like to see EventEmitter etc being implemented in node too so that ppl building cross browser/platform works the same way without any additional dependencies |
node/lib/events.js
Line 198 in 2f9c9ee
Why do you bind ”this“ here?It is not compatible with browser.
The text was updated successfully, but these errors were encountered: