79d378f2bd
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
13 lines
209 B
Kotlin
Vendored
13 lines
209 B
Kotlin
Vendored
fun foo(x: Int) {
|
|
var y = x
|
|
y++
|
|
println(y)
|
|
++y
|
|
println(y)
|
|
y += 2
|
|
println(y)
|
|
}
|
|
|
|
// LINES(JS): 1 9 2 2 3 3 4 4 5 5 6 6 7 7 8 8
|
|
// LINES(JS_IR): 1 1 2 3 3 4 4 5 5 6 6 7 7 8 8
|