minifier icon indicating copy to clipboard operation
minifier copied to clipboard

0.8.0; issue with arrow functions?

Open frumbert opened this issue 7 years ago • 1 comments

If I try to minify a script including an arrow function like this:

Object.keys(obj).forEach(key => { data[obj[key].name] = obj[key].value; });

I get an undefined:1553 throw new JS_Parse_Error(message, filename, line, col, pos); ^ Error (etc)

If I minify the same file but change the arrow function back to a regular function

Object.keys(obj).forEach(function(key) { data[obj[key].name] = obj[key].value; });

all works fine.

frumbert avatar Nov 09 '17 01:11 frumbert

This is a duplicate of #19, in that the version of uglifyjs used only supports ES5 syntax

fizker avatar Nov 09 '17 09:11 fizker