enhance conditionals (#3798)

This commit is contained in:
Alex Lam S.L
2020-04-18 15:32:22 +01:00
committed by GitHub
parent 60d4e7b09f
commit fd6144d95b
4 changed files with 99 additions and 43 deletions

View File

@@ -1384,7 +1384,7 @@ hoist_decl: {
}
expect: {
var a, b;
x() ? y() : z();
(x() ? y : z)();
}
}

View File

@@ -1173,6 +1173,7 @@ var_catch_toplevel: {
x();
} catch (a) {
var a;
var a;
}
}();
}

View File

@@ -22,8 +22,10 @@ issue_1639_1: {
console.log(a, b);
}
expect: {
for (var a = 100, b = 10, L1 = 5; --L1 > 0;)
if (--b, 0) var ignore = 0;
for (var a = 100, b = 10, L1 = 5; --L1 > 0;) {
var ignore;
--b;
}
console.log(a, b);
}
expect_stdout: "100 6"