enhance if_return (#5326)
This commit is contained in:
@@ -327,7 +327,7 @@ issue_512: {
|
||||
}
|
||||
}
|
||||
|
||||
if_var_return: {
|
||||
if_var_return_1: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
if_return: true,
|
||||
@@ -373,6 +373,52 @@ if_var_return: {
|
||||
}
|
||||
}
|
||||
|
||||
if_var_return_2: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
if_return: true,
|
||||
sequences: true,
|
||||
}
|
||||
input: {
|
||||
(function() {
|
||||
var a = w();
|
||||
if (x())
|
||||
return y();
|
||||
z();
|
||||
})();
|
||||
}
|
||||
expect: {
|
||||
(function() {
|
||||
var a = w();
|
||||
return x() ? y() : (z(), void 0);
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
if_var_return_3: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
if_return: true,
|
||||
sequences: true,
|
||||
}
|
||||
input: {
|
||||
function f() {
|
||||
if (u())
|
||||
return v();
|
||||
var a = w();
|
||||
if (x())
|
||||
return y();
|
||||
z();
|
||||
}
|
||||
}
|
||||
expect: {
|
||||
function f() {
|
||||
return u() ? v() : (a = w(), x() ? y() : (z(), void 0));
|
||||
var a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if_if_return_return: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
|
||||
Reference in New Issue
Block a user