improve handling of non-trivial assignment values (#5227)

This commit is contained in:
Alex Lam S.L
2021-12-22 23:55:06 +00:00
committed by GitHub
parent 343bf6d7a5
commit 7b2eb4b5ff
13 changed files with 423 additions and 217 deletions

View File

@@ -1728,7 +1728,8 @@ issue_2768: {
}
expect: {
var a = "FAIL";
var c = (d = a, void (d && (a = "PASS")));
d = a;
var c = void (d && (a = "PASS"));
var d;
console.log(a, typeof c);
}
@@ -2382,7 +2383,8 @@ issue_3664: {
}
expect: {
console.log(function() {
var a, b = (a = (a = [ b && console.log("FAIL") ]).p = 0, 0);
a = (a = [ b && console.log("FAIL") ]).p = 0;
var a, b = 0;
return "PASS";
}());
}
@@ -2551,10 +2553,9 @@ issue_3899: {
console.log(typeof a);
}
expect: {
function a() {
console.log(typeof function() {
return 2;
}
console.log(typeof a);
});
}
expect_stdout: "function"
}