matthewmueller / joy

A delightful Go to Javascript compiler (ON HOLD)
https://mat.tm/joy
GNU General Public License v3.0
1.32k stars 35 forks source link

Compile to object literals when struct definitions don't have any functions attached to them #14

Closed matthewmueller closed 6 years ago

matthewmueller commented 6 years ago
type Github struct {
  Name string `js:"name"`
}

func main() {
  println(Github{
    Name: "matt",
  })
}

Should compile to:

function main() {
  console.log({
    name: "matt",
  })
}

But right now it compiles to: new Github({ name: "matt" })

matthewmueller commented 6 years ago

done, this turned out awesome