prevented the _is_kind_of primitive handler from returning an error
This commit is contained in:
parent
303b49270d
commit
a240b0be7d
@ -54,7 +54,7 @@ class MyObject(TestObject)
|
||||
method(#class) main
|
||||
{
|
||||
| tc limit |
|
||||
|
||||
(10 isKindOf: 20) dump.
|
||||
tc := %(
|
||||
## 0 - 4
|
||||
[(Object isKindOf: Class) == true],
|
||||
@ -63,9 +63,11 @@ class MyObject(TestObject)
|
||||
[(Class isKindOf: Apex) == true],
|
||||
[(Class isKindOf: Object) == false],
|
||||
|
||||
## 5-9
|
||||
[(Apex isKindOf: Class) == true],
|
||||
[(SmallInteger isKindOf: Integer) == false],
|
||||
[(10 isKindOf: Integer) == true],
|
||||
[(10 isKindOf: 20) == false],
|
||||
|
||||
[(Apex isMemberOf: Class) == true],
|
||||
[(Class isMemberOf: Class) == true]
|
||||
|
@ -2105,9 +2105,8 @@ static moo_pfrc_t pf_is_kind_of (moo_t* moo, moo_ooi_t nargs)
|
||||
rcv = MOO_STACK_GETRCV(moo, nargs);
|
||||
_class = MOO_STACK_GETARG(moo, nargs, 0);
|
||||
|
||||
MOO_PF_CHECK_ARGS (moo, nargs, MOO_CLASSOF(moo, _class) == moo->_class);
|
||||
|
||||
if (moo_iskindof(moo, rcv, (moo_oop_class_t)_class))
|
||||
if (MOO_CLASSOF(moo, _class) == moo->_class &&
|
||||
moo_iskindof(moo, rcv, (moo_oop_class_t)_class))
|
||||
{
|
||||
MOO_STACK_SETRET (moo, nargs, moo->_true);
|
||||
}
|
||||
|
@ -978,6 +978,8 @@ int moo_iskindof (moo_t* moo, moo_oop_t obj, moo_oop_class_t _class)
|
||||
{
|
||||
moo_oop_class_t c;
|
||||
|
||||
MOO_ASSERT (moo, MOO_CLASSOF(moo,_class) == moo->_class);
|
||||
|
||||
c = MOO_CLASSOF(moo,obj); /* c := self class */
|
||||
if (c == moo->_class)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user