added moo_ischildclassof().

filled pf_context_find_exception_handler() to speed up exception handling a bit
This commit is contained in:
hyunghwan.chung
2019-07-05 08:12:42 +00:00
parent 3f6b0335d9
commit 7f835ea120
4 changed files with 84 additions and 5 deletions

View File

@ -1066,3 +1066,15 @@ int moo_iskindof (moo_t* moo, moo_oop_t obj, moo_oop_class_t _class)
}
return 0;
}
int moo_ischildclassof (moo_t* moo, moo_oop_class_t c, moo_oop_class_t k)
{
c = (moo_oop_class_t)c->superclass;
while ((moo_oop_t)c != moo->_nil)
{
if (c == k) return 1;
c = (moo_oop_class_t)c->superclass;
}
return 0;
}