Compare commits
2 Commits
master
...
superclass
Author | SHA1 | Date | |
---|---|---|---|
16139847f9 | |||
751d4f4fb9 |
@ -2,12 +2,14 @@ use rbx_dom_weak::{types::Ref,WeakDom};
|
|||||||
|
|
||||||
pub fn class_is_a(class:&str,superclass:&str)->bool{
|
pub fn class_is_a(class:&str,superclass:&str)->bool{
|
||||||
class==superclass
|
class==superclass
|
||||||
||rbx_reflection_database::get().classes.get(class)
|
||{
|
||||||
.is_some_and(|descriptor|
|
let db=rbx_reflection_database::get();
|
||||||
descriptor.superclass.as_ref().is_some_and(|class_super|
|
match (db.classes.get(class),db.classes.get(superclass)){
|
||||||
class_is_a(class_super,superclass)
|
(Some(class),Some(superclass))=>db.superclasses_iter(class)
|
||||||
)
|
.any(|cls|core::ptr::addr_eq(cls,superclass)),
|
||||||
)
|
_=>false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
|
Loading…
Reference in New Issue
Block a user