enhance unused (#4858)

This commit is contained in:
Alex Lam S.L
2021-04-22 03:58:50 +01:00
committed by GitHub
parent 3c161a6662
commit bddb5a0102
4 changed files with 61 additions and 9 deletions

View File

@@ -1796,7 +1796,7 @@ function createClassLiteral(recurmax, stmtDepth, canThrow, name) {
if (SUPPORT.class_field && rng(2)) {
s += internal || createObjectKey(recurmax, stmtDepth, canThrow);
if (rng(5)) {
async = bug_async_class_await && fixed;
async = bug_async_class_await && fixed && 0;
generator = false;
s += " = " + createExpression(recurmax, NO_COMMA, stmtDepth, fixed ? canThrow : CANNOT_THROW);
generator = save_generator;
@@ -2000,7 +2000,7 @@ function isBannedKeyword(name) {
case "arguments":
return in_class;
case "await":
return async;
return async !== false;
case "yield":
return generator || in_class;
}