1
Vote

ajaxmin produces invalid js code with arrow functions

description

Consider this piece of code
var array = [1, 2, 3]
array.map(num => { 
        return { 
                x: num * 2,
                y: num * 3 
        }
})
ajaxmin will output this:
a.map(n => { x: n * 2, y: n * 3  })
which is invalid and will break the production app.

It should be something like this instead:
a.map(n => ({ x: n * 2, y: n * 3  }))
Thanks for your attention.

comments