fix corner case in hoist_props (#5499)

fixes #5498
This commit is contained in:
Alex Lam S.L
2022-06-07 16:29:42 +01:00
committed by GitHub
parent a758b40e3f
commit 123f9cf987
2 changed files with 25 additions and 2 deletions

View File

@@ -1203,3 +1203,24 @@ issue_5441: {
}
expect_stdout: "object"
}
issue_5498: {
options = {
hoist_props: true,
reduce_vars: true,
toplevel: true,
}
input: {
var o = {
__proto__: 42,
};
while (console.log(typeof o.__proto__));
}
expect: {
var o = {
__proto__: 42,
};
while (console.log(typeof o.__proto__));
}
expect_stdout: "object"
}