Rewrite temporary variable elimination

This commit is contained in:
Alexey Andreev
2016-03-23 11:54:58 +03:00
parent 8709289b0a
commit cfdce8eaca
11 changed files with 642 additions and 144 deletions
@@ -0,0 +1,17 @@
function test1(n) {
var $tmp;
if (n > 0) {
$tmp = 23;
}
return typeof $tmp;
}
function box() {
var result = test1(5);
if (result != "number") return "fail1: " + result;
result = test1(-5);
if (result != "undefined") return "fail2: " + result;
return "OK";
}