Implement inlining of Array constructor in JS BE

See KT-15456
This commit is contained in:
Alexey Andreev
2017-04-28 16:24:31 +03:00
parent 6523f237a6
commit 1900b20e6e
16 changed files with 156 additions and 71 deletions
@@ -1,6 +1,3 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
fun testArray() {
Array<String>(5) { i ->
if (i == 3) return
@@ -17,8 +14,44 @@ fun testIntArray() {
throw AssertionError()
}
fun testLongArray() {
LongArray(5) { i ->
if (i == 3) return
i.toLong()
}
throw AssertionError()
}
fun testBooleanArray() {
BooleanArray(5) { i ->
if (i == 3) return
i % 2 == 0
}
throw AssertionError()
}
fun testCharArray() {
CharArray(5) { i ->
if (i == 3) return
i.toChar()
}
throw AssertionError()
}
fun testFloatArray() {
FloatArray(5) { i ->
if (i == 3) return
i.toFloat()
}
throw AssertionError()
}
fun box(): String {
testArray()
testIntArray()
testLongArray()
testBooleanArray()
testCharArray()
testFloatArray()
return "OK"
}