[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
@@ -3,18 +3,18 @@ function f(x) {
}
function box() {
var result1, result2, $a, $b;
var $a, $b;
if (f(true)) {
$a = "1";
}
result1 = $a;
var result1 = $a;
if (result1 !== "1") return "fail1: " + result1;
if (f(false)) {
$b = "1";
}
result2 = $b;
var result2 = $b;
if (result2 !== void 0) return "fail2: " + result2;
return "OK";