jlongster / es6-macros

A collection of sweet.js macros that implement ES6 features for ES5
BSD 2-Clause "Simplified" License
237 stars 18 forks source link

fat arrow macro issue #23

Open freemountain opened 10 years ago

freemountain commented 10 years ago

The fat arrow macro includes this tenary operator: function(/* ... */){/* ... */}.bind(this, typeof arguments !== "undefined" ? arguments : undefined)

I think this is needless, the operator returns 'undefined' if arguments is undefined or the arguments object.I think it does the same without the tenary operator: function(/* ... */){/* ... */}.bind(this, arguments)

disnet commented 10 years ago

If arguments is undefined .bind(this, arguments) throws an exception thus the need for the ternary check.