enhance if_return to handle return void... (#1977)

fixes #512
This commit is contained in:
Alex Lam S.L
2017-05-20 15:58:46 +08:00
committed by GitHub
parent 5bf8d7e949
commit 58fae7dc07
4 changed files with 38 additions and 11 deletions

View File

@@ -302,3 +302,25 @@ issue_1437_conditionals: {
}
}
}
issue_512: {
options = {
conditionals: true,
if_return: true,
}
input: {
function a() {
if (b()) {
c();
return;
}
throw e;
}
}
expect: {
function a() {
if (!b()) throw e;
c();
}
}
}