JS: fix Kotlin.isType for case of traits
This commit is contained in:
+6
-1
@@ -422,7 +422,7 @@
|
||||
return object instanceof klass;
|
||||
}
|
||||
|
||||
if (object.constructor != null) {
|
||||
if (isTrait(klass) && object.constructor != null) {
|
||||
metadata = object.constructor.$metadata$;
|
||||
if (metadata != null) {
|
||||
return isInheritanceFromTrait(metadata, klass);
|
||||
@@ -432,6 +432,11 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
function isTrait(klass) {
|
||||
var metadata = klass.$metadata$;
|
||||
return metadata != null && metadata.type === Kotlin.TYPE.TRAIT;
|
||||
}
|
||||
|
||||
// TODO Store callable references for members in class
|
||||
Kotlin.getCallableRefForMemberFunction = function (klass, memberName) {
|
||||
return function () {
|
||||
|
||||
Reference in New Issue
Block a user