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
14 lines
300 B
Kotlin
Vendored
14 lines
300 B
Kotlin
Vendored
var log = ""
|
|
|
|
fun box(x: String?) {
|
|
log +=
|
|
x
|
|
?:
|
|
try { foo() } finally { log += "finally" }
|
|
}
|
|
|
|
fun foo() = "bar"
|
|
|
|
// LINES(JS): 3 8 7 7 4 4 4 5 5 7 7 7 7 * 5 4 5 10 10 10 * 1 * 1
|
|
// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 4 * 5 5 * 7 7 7 * 5 4 4 10 10 10 10 * 1
|