handle flow control in loops with reduce_vars (#3069)

fixes #3068
This commit is contained in:
Alex Lam S.L
2018-04-10 06:51:03 +08:00
committed by GitHub
parent 183da16896
commit b82fd0ad41
2 changed files with 102 additions and 26 deletions

View File

@@ -5654,3 +5654,59 @@ issue_3042_2: {
"true",
]
}
issue_3068_1: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
(function() {
do {
continue;
var b = "defined";
} while (b && b.c);
})();
}
expect: {
(function() {
do {
continue;
var b = "defined";
} while (b && b.c);
})();
}
expect_stdout: true
}
issue_3068_2: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
(function() {
do {
try {
while ("" == typeof a);
} finally {
continue;
}
var b = "defined";
} while (b && b.c);
})();
}
expect: {
(function() {
do {
try {
while ("" == typeof a);
} finally {
continue;
}
var b = "defined";
} while (b && b.c);
})();
}
expect_stdout: true
}