Objects, arrays and functions are copied, passed and compared by reference in Javascrpt iirc. So top === self
as they reference the same object. And from that it is clear that the equality of top.location === self.location
must hold as well.
References