JS: prohibit declaration names that clash with JS builtin functions

See KT-18095, KT-17475, KT-18105, KT-5259
This commit is contained in:
Alexey Andreev
2017-10-16 18:51:14 +03:00
parent e0eea15a4c
commit 6adb62f3a2
12 changed files with 288 additions and 8 deletions
@@ -0,0 +1,19 @@
// EXPECTED_REACHABLE_NODES: 1135
open class C {
private fun constructor() = "C.constructor"
fun f(): String = constructor()
}
class D : C()
fun box(): String {
val d = D()
val x = d.f()
if (x != "C.constructor") return "fail1: $x"
if (x.asDynamic().constructor === D::class.js) return "fail2"
return "OK"
}