Yes, but like I said, the code works fine as long as EventDispatcher is not a Singleton (like you…
Radu B. Gaspar
1
It is the same result with a singleton, I’ve modified the code (http://jsbin.com/rokuyi/edit?js,console). And if you look at the last console.log, you can see that the constructor is correct.
I don’t think it is a bug, this is how instanceof works, it just finds on the prototype chain EventDispatcher an as a constructor on both cases.
I might be missing something, how do you check whether it is a wrong instance?
I don’t mean to be a hater, I am also trying to understand :).