Skip to content

Commit

Permalink
JS: properly parse {a:b=1} when part of arrow function arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jun 17, 2021
1 parent 2d9ed17 commit d986e4c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit d986e4c

Please sign in to comment.