Added ClassUtil.isSameClass(), reimplemented another function using

the constructor property.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4322 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-12 01:19:30 +00:00
parent c85996ae5d
commit 53aacc4bbc
3 changed files with 17 additions and 6 deletions
+6 -1
View File
@@ -31,9 +31,14 @@ public class ClassUtil
return new clazz();
}
public static function isSameClass (obj1 :Object, obj2 :Object) :Boolean
{
return (obj1.constructor == obj2.constructor);
}
public static function getClass (obj :Object) :Class
{
return getClassByName(getClassName(obj));
return Class(obj.constructor);
}
public static function getClassByName (cname :String) :Class
+1 -3
View File
@@ -43,9 +43,7 @@ public class Name extends Object
// from interface Hashable
public function equals (other :Object) :Boolean
{
return (other != null) &&
// this is a check to see if they are the same class
(other.constructor == Object(this).constructor) &&
return (other != null) && ClassUtil.isSameClass(other, this) &&
(getNormal() === (other as Name).getNormal());
}