jetheredge / SquishIt

Lets you *easily* bundle some css and javascript! Check out the Google group if you have questions!
http://groups.google.com/group/squishit
MIT License
459 stars 119 forks source link

'EcmaScript.NET.EcmaScriptRuntimeException'{"syntax error"} #346

Open crwagner opened 6 years ago

crwagner commented 6 years ago

I'm getting this exception when proccessing the following javascript function

arrayGroupBy: function(xs, key) {
    return xs.reduce(function(rv, x) {
        var v = key instanceof Function ? key(x) : x[key];
        // this line below throws the exception
        var el = rv.find((r) => r && r.key === v);
        if (el) {
            el.values.push(x);
        } else {
            rv.push({ key: v, values: [x] });
        }
        return rv;
    }, []);
}
AlexCuse commented 6 years ago

What version are you using? This is likely a YUI / ECMAScript issue that might be resolved by updating SquishIt.

I usually prefer YUI but you can also try using the AjaxMin minifiers.