fix corner cases in properties (#5178)

fixes #5177
This commit is contained in:
Alex Lam S.L
2021-11-16 20:21:44 +00:00
committed by GitHub
parent 77f7ae5ba2
commit ae5c3ee8a1
6 changed files with 172 additions and 25 deletions

View File

@@ -1152,8 +1152,9 @@ function OutputStream(options) {
});
}
function print_arrow(self, output) {
if (self.argnames.length == 1 && self.argnames[0] instanceof AST_SymbolFunarg && !self.rest) {
self.argnames[0].print(output);
var argname = self.argnames.length == 1 && !self.rest && self.argnames[0];
if (argname instanceof AST_SymbolFunarg && argname.name != "yield") {
argname.print(output);
} else {
print_funargs(self, output);
}