alexguan/node-zookeeper-client — pull request #29 by jconti (2014-10-31 17:43:18+00:00)
Title: Fix problem where duplicate watchers are not detected.

I was having a problem where node complained about too many listeners. Eventually a co-worker helped me track it to this comparison. To properly compare functions which may be (probably are) anonymous, the toString() method is required. I used this article to confirm this idea: http://stackoverflow.com/questions/21334835/how-do-you-compare-anonymous-functions-in-javascript. The attached fix resolved the issue by properly identifying watcher functions that were the same.