fix corner case in functions (#4789)

fixes #4788
This commit is contained in:
Alex Lam S.L
2021-03-16 12:58:51 +00:00
committed by GitHub
parent b98ce6c84f
commit 9a9543013c
4 changed files with 50 additions and 5 deletions

View File

@@ -1947,7 +1947,11 @@ function createTypeofExpr(recurmax, stmtDepth, canThrow) {
}
function createValue() {
return VALUES[rng(VALUES.length)];
var v;
do {
v = VALUES[rng(VALUES.length)];
} while (v == "new.target" && rng(200));
return v;
}
function createBinaryOp(noComma, canThrow) {