[JS IR] Implement MoveTemporaryVariableDeclarationToAssignment optimization

This commit is contained in:
Alexander Korepanov
2023-07-06 17:24:28 +02:00
committed by Space Team
parent 25f7b81d51
commit 524c475834
23 changed files with 929 additions and 25 deletions
@@ -0,0 +1,10 @@
inline fun jsUpper(c: Char) = c.toString().asDynamic().toUpperCase().unsafeCast<String>()
inline fun upper(c: Char): Char = jsUpper(c)[0]
// EXPECT_GENERATED_JS: function=test expect=tempVarDeclOnAssignmentTest.js
fun test(a: Char, b: Char): String {
return "${upper(a)}${upper(b)}"
}
fun box() = test('o', 'k')