fix corner case in comparisons (#3877)

This commit is contained in:
Alex Lam S.L
2020-05-10 23:33:52 +01:00
committed by GitHub
parent c76ee4b868
commit c1dd49e075
2 changed files with 38 additions and 1 deletions

View File

@@ -93,6 +93,36 @@ self_comparison_2: {
expect_stdout: "false true"
}
self_comparison_3: {
options = {
comparisons: true,
}
input: {
var a;
function f() {
var b = a;
a = null;
return b;
}
for (var i = 0; i < 2; i++)
console.log(f() === f());
}
expect: {
var a;
function f() {
var b = a;
a = null;
return b;
}
for (var i = 0; i < 2; i++)
console.log(f() === f());
}
expect_stdout: [
"false",
"true",
]
}
issue_2857_1: {
options = {
comparisons: true,