Prohibit from eliminating non-local temporary variables

This commit is contained in:
Alexey Andreev
2016-03-22 13:48:41 +03:00
parent af7ddb4572
commit 8709289b0a
9 changed files with 93 additions and 4 deletions
@@ -0,0 +1,14 @@
var $tmp;
function test(a, b, c) {
$tmp = a + b;
return $tmp + c;
}
function box() {
var result = test(2, 3, 4);
if (result != 9) return "fail1: " + result;
if ($tmp != 5) return "fail2: " + $tmp;
return "OK"
}