Files
kotlin-fork/js/js.translator/testData/lineNumbers/inlineLocalVarsRef.kt
T
Alexander Korepanov 79d378f2bd [JS IR] Perform optimizations on the generated JS code
The patch adopts and reuses the optimizations from the legacy backend.

The optimizations remove useless temporary variables,
statements and simplify generated JS code.

The optimizations can be disabled by `-Xoptimize-generated-js=false`.

Related to KT-51139
2023-04-18 12:49:33 +00:00

14 lines
256 B
Kotlin
Vendored

inline fun foo(x: Int) {
val y = x > 23
if (y) {
println("foo")
}
}
fun bar() {
foo(42)
}
// LINES(JS): 1 1 1 1 1 6 2 2 3 3 4 4 8 10 2 2 9 2 3 3 4 4
// LINES(JS_IR): 1 1 2 3 3 3 4 4 8 8 * 2 3 3 3 4 4