engineforce/ImmutableAssign

ES6 arrow functions without the `return` keyword don't work as getProp

peterholak opened this issue · 2 comments

The library currently requires the keyword return inside the getProp function.

This is not compatible with one-liner ES6 arrow functions without curly braces, such as a => a+5, you have to write a => { return a+5 }, which is not a huge issue, but not ideal.

It works when the code is transpiled into ES5, but people will eventually stop doing that in the future. It is already unnecessary for node.js projects.

Not sure what the performance hit of detecting such syntax would be though 😐 .

Thanks for the feedback, it was on my list of todos. I will try to do that in the next release.

Done in 1.0.29