fix corner case in hoist_vars (#4860)

fixes #4859
This commit is contained in:
Alex Lam S.L
2021-04-21 22:47:21 +01:00
committed by GitHub
parent c58e174647
commit 3c161a6662
3 changed files with 37 additions and 10 deletions

View File

@@ -1796,11 +1796,9 @@ function createClassLiteral(recurmax, stmtDepth, canThrow, name) {
if (SUPPORT.class_field && rng(2)) {
s += internal || createObjectKey(recurmax, stmtDepth, canThrow);
if (rng(5)) {
async = false;
async = bug_async_class_await && fixed;
generator = false;
if (bug_async_class_await && fixed) addAvoidVar("await");
s += " = " + createExpression(recurmax, NO_COMMA, stmtDepth, fixed ? canThrow : CANNOT_THROW);
if (bug_async_class_await && fixed) removeAvoidVar("await");
generator = save_generator;
async = save_async;
}