From d986e4c76b5f59daaaa319214e264d2bcec79cc6 Mon Sep 17 00:00:00 2001 From: Taco de Wolff Date: Thu, 17 Jun 2021 10:46:47 -0400 Subject: [PATCH] JS: properly parse {a:b=1} when part of arrow function arguments --- js/parse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/parse.go b/js/parse.go index 680e1f9..8b1c793 100644 --- a/js/parse.go +++ b/js/parse.go @@ -2192,7 +2192,9 @@ func (p *Parser) exprToBinding(expr IExpr) (binding IBinding) { } var bindingElement BindingElement bindingElement.Binding = p.exprToBinding(item.Value) - if item.Init != nil { + if bindingElement.Binding == nil { + bindingElement = p.exprToBindingElement(item.Value) + } else if item.Init != nil { bindingElement.Default = item.Init } bindingObject.List = append(bindingObject.List, BindingObjectItem{Key: item.Name, Value: bindingElement})