I just learned today that self and this does not refer to the same
thing! It appears that this always refers to the owner of the
function. self was referring to the owner of the outer function, which
was the Connection class of the driver, while this was referring to
the owner of the inner function, the net.stream class, which calls
addListener.
On Oct 7, 10:57 pm, Kristina Chodorow <
krist...@10gen.com> wrote:
> No, self and this are the same. I think he's using the two to distinguish
> between methods that belong to the connection class and those that it
> inherits from EventEmitter. So, anything defined in Connection is called
> with this.whatever(), anything defined in EventEmitter is called with
> self.whatever().
>