enhance comparisons (#5358)

This commit is contained in:
Alex Lam S.L
2022-02-18 20:27:17 +00:00
committed by GitHub
parent 82e8ebd77d
commit 9686379884
3 changed files with 40 additions and 20 deletions

View File

@@ -493,3 +493,32 @@ issue_3413: {
}
expect_stdout: "PASS"
}
nullish_assign: {
options = {
comparisons: true,
}
input: {
var a;
void 0 !== (a = "PASS".split("")) && null !== a && console.log(a.join("-"));
}
expect: {
var a;
null != (a = "PASS".split("")) && console.log(a.join("-"));
}
expect_stdout: "P-A-S-S"
}
nullish_chain: {
options = {
comparisons: true,
}
input: {
var a;
A || B || void 0 === a || null === a || C;
}
expect: {
var a;
A || B || null == a || C;
}
}