JS: prevent optimizer from removing access to dynamic property access. See KT-15278

This commit is contained in:
Alexey Andreev
2016-12-26 15:39:27 +03:00
parent e1bec0df2e
commit e6be418dd3
4 changed files with 32 additions and 2 deletions
@@ -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"
}