avoid extends error in ufuzz (#5447)

This commit is contained in:
Alex Lam S.L 2022-05-16 04:11:10 +01:00 committed by GitHub
parent fc6a66836a
commit 3aa92c76cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1805,7 +1805,7 @@ function createClassLiteral(recurmax, stmtDepth, canThrow, name) {
if (canThrow && rng(20) == 0) {
s += p;
} else {
s += "(typeof " + p + ' == "function" && typeof ' + p + '.prototype == "object" ? ' + p + " : function() {})";
s += "(typeof " + p + ' == "function" && typeof ' + p + '.prototype == "object" && ' + p + ".constructor === Function ? " + p + " : function() {})";
}
}
s += " {\n";