enhance if_return (#3560)

This commit is contained in:
Alex Lam S.L
2019-11-01 02:08:31 +08:00
committed by GitHub
parent 1e9b576ee9
commit 815eff1f7c
2 changed files with 47 additions and 12 deletions

View File

@@ -409,3 +409,31 @@ typeof_defined_4: {
"object" != typeof A || "object" == typeof B || B;
}
}
emberjs_global: {
options = {
comparisons: true,
conditionals: true,
if_return: true,
passes: 2,
side_effects: true,
toplevel: true,
typeofs: true,
unused: true,
}
input: {
var a;
if (typeof A === "object") {
a = A;
} else if (typeof B === "object") {
a = B;
} else {
throw new Error("PASS");
}
}
expect: {
if ("object" != typeof A && "object" != typeof B)
throw new Error("PASS");
}
expect_stdout: Error("PASS")
}