1
0
Fork 0

Fix isa() when used on classes with superclasses.

This commit is contained in:
andy 2008-02-07 18:03:03 +00:00
parent b94a02a4f5
commit bedac8ec83

View file

@ -3,11 +3,10 @@
# (class) object. Example: isa(someObject, props.Node)
#
var isa = func(obj, class) {
if(obj == nil or !contains(obj, "parents")) { return 0; }
foreach(c; obj.parents) {
if(c == class) { return 1; }
elsif(isa(obj, c)) { return 1; }
}
if(contains(obj, "parents"))
foreach(c; obj.parents)
if(c == class or isa(c, class))
return 1;
return 0;
}