Fix temporary variable elimination in JS BE

Don't eliminate temporary variable when between its usage and its
definition there's assignment to a non-local variable.

Fix KT-17540
This commit is contained in:
Alexey Andreev
2017-04-27 19:51:04 +03:00
parent 8d0eb207e3
commit d89ce80d97
6 changed files with 41 additions and 1 deletions
@@ -0,0 +1,11 @@
var value = "OK";
function foo(newValue) {
var $tmp = value;
value = newValue;
return $tmp;
}
function box() {
return foo("fail");
}