support limited ufuzz testing for export (#4693)

fixes #4692
This commit is contained in:
Alex Lam S.L
2021-02-26 20:56:34 +00:00
committed by GitHub
parent ac26993b5a
commit ba4a771bbc
7 changed files with 166 additions and 47 deletions

View File

@@ -1176,15 +1176,7 @@ var AST_ExportDefault = DEFNODE("ExportDefault", "body", {
});
},
_validate: function() {
if (this.body instanceof AST_Class && this.body.name) {
if (!(this.body instanceof AST_DefClass)) {
throw new Error("body must be AST_DefClass when named");
}
} else if (this.body instanceof AST_Lambda && this.body.name) {
if (!(this.body instanceof AST_LambdaDefinition)) {
throw new Error("body must be AST_LambdaDefinition when named");
}
} else {
if (!(this.body instanceof AST_DefClass || this.body instanceof AST_LambdaDefinition)) {
must_be_expression(this, "body");
}
},