JS: prevent optimizer from removing access to dynamic property access. See KT-15278
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
var log = "";
|
||||
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "foo", {
|
||||
"get" : function () {
|
||||
log += "foo called";
|
||||
return "OK"
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
external class C
|
||||
|
||||
inline val C.foo: String
|
||||
get() = asDynamic().foo
|
||||
|
||||
external val log: String
|
||||
|
||||
fun box(): String {
|
||||
val c = C()
|
||||
c.foo
|
||||
if (log != "foo called") return "fail: $log"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user