JS/Inlining: minor improvements and clarifications after code review. Test whether expression without side effect does not prevent to relocate another expressions

This commit is contained in:
Alexey Andreev
2016-06-06 12:37:37 +03:00
parent 6b99d4e1c5
commit 07d5a4506c
10 changed files with 63 additions and 23 deletions
@@ -4,18 +4,18 @@ function f(x) {
function box() {
var result1, result2, $a, $b;
if (f(true)) {
$a = "1";
}
result1 = $a;
if (result1 !== "1") return "fail1: " + result1;
if (f(false)) {
$b = "1";
}
result2 = $b;
if (result2 !== void 0) return "fail2: " + result2;
return "OK";
}