JS/Inlining: introduce removal of unused variables

This commit is contained in:
Alexey Andreev
2016-05-05 10:52:10 +03:00
parent 776c7447b1
commit 551ed28d84
6 changed files with 133 additions and 3 deletions
@@ -0,0 +1,30 @@
var global = 0;
function test1() {
global++;
return global;
}
function test2() {
global++;
return global;
}
function test3() {
global++;
var $b = global--;
return $b + $b;
}
function box() {
var result = test1();
if (result != 1) return "fail1: " + result;
result = test2();
if (result != 2) return "fail2: " + result;
result = test3();
if (result != 6) return "fail3: " + result;
return "OK"
}