JS: use prototype when checking is against interface
See KT-20527
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1112
|
||||
interface A {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
class B : A {
|
||||
override fun foo(): String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val b = B::class.js
|
||||
val c = js("""
|
||||
function C() {
|
||||
b.call(this);
|
||||
};
|
||||
C.prototype = Object.create(b.prototype);
|
||||
C.prototype.constructor = C;
|
||||
new C();
|
||||
""")
|
||||
|
||||
if (c !is B) return "fail: c !is B"
|
||||
if (c !is A) return "fail: c !is A"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user