Check that the other name is the same subclass of Name, not just a Name.
(And found a faster way to compare the classes of two objects.) git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4321 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -43,7 +43,9 @@ public class Name extends Object
|
|||||||
// from interface Hashable
|
// from interface Hashable
|
||||||
public function equals (other :Object) :Boolean
|
public function equals (other :Object) :Boolean
|
||||||
{
|
{
|
||||||
return (ClassUtil.getClass(other) == Name) &&
|
return (other != null) &&
|
||||||
|
// this is a check to see if they are the same class
|
||||||
|
(other.constructor == Object(this).constructor) &&
|
||||||
(getNormal() === (other as Name).getNormal());
|
(getNormal() === (other as Name).getNormal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user