diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index 2754ffba..d06f6552 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -1210,7 +1210,7 @@ issue_2994: { if_return: true } input: { - function f() { + function f(condition1, condition2, condition3) { if (condition1) { if (condition2) { return aValue; @@ -1225,22 +1225,40 @@ issue_2994: { } } } + let aValue = 2, anotherValue = 3; + for (let i = 0; i < 8; ++i) { + console.log(f(i & 4, i & 2, i & 1)); + } } expect: { - function f() { + function f(condition1, condition2, condition3) { if (condition1) { if (condition2) return aValue; { - const variable1 = 'something'; + const variable1 = "something"; if (condition3) { - const variable2 = 'else'; + const variable2 = "else"; return anotherValue; } return; } } } + let aValue = 2, anotherValue = 3; + for (let i = 0; i < 8; ++i) + console.log(f(4 & i, 2 & i, 1 & i)); } + expect_stdout: [ + "undefined", + "undefined", + "undefined", + "undefined", + "undefined", + "3", + "2", + "2", + ] + node_version: ">=6" } hoist_decl: {