<div dir="ltr"><div>The footgun argument is not very strong because arrow functions provide the same footgun ;) Unless the policy is to reject the shorthand version?<br><br></div>And unfortunately we can't replace most of the usages with arrow functions because they are often defined as class functions in objects/prototypes where the `this` value needs to be bound to the object instance. So we would need to replace them with the long version of regular functions.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 1:42 PM, Richard Newman <span dir="ltr"><<a href="mailto:rnewman@mozilla.com" target="_blank">rnewman@mozilla.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">> Since the syntax is so similar, I think that is a better argument for migrating to standard arrow functions rather than keeping the non-standard syntax. The JS team has an ongoing goal to remove SpiderMonkey's non-standard language extensions.<br>
<br>
</div>Also, some of us have had a review policy (for years!) of rejecting the non-standard syntax. Not only does it break syntax hilighting in some editors, but it's a gigantic footgun:<br>
<br>
function(a) a + 1<br>
<br>
is very easy to screw up into<br>
<br>
function(a) {<br>
log("Wee!");<br>
a + 1;<br>
}<br>
<br>
which of course won't work at all. (Yes, I've seen this happen in the wild.)<br>
<br>
I'll be glad to see it gone. Just use arrows.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" target="_blank">https://mail.mozilla.org/listinfo/firefox-dev</a><br>
</div></div></blockquote></div><br></div>