Why is it that all new chrome features are usually announced on random blogs all over the place, while the official "chromereleasenotes" blogspot blog has almost never any useful information? There they all seem to talk about various minor security fixes in the stable channel posts, but almost never are new features highlighted. Is it really necessary to track the beta and canary release notes and svn logs to stay on top of things?
Regarding the example at the end of the post, how does it even make sense to allow an anonymous arrow function be a "paramater name" (yes!) of another anonymous function? I guess the empty object becomes a destructuring parameter that doesn't do anything but the function is confusing:<p><pre><code> (
(
{},
{},
({},{})=>({},{})
)=>
(({},{})=>({},{}),{},{})
)({},{})
</code></pre>
I can rewrite that to be more clear:<p><pre><code> //(({},{})=>({},{}),{},{}) evaluates to {}
//({},{}) evaluates to {}
let fn = ({}, {}, ({},{})=>{}) => {};
fn({},{});
</code></pre>
This is just a syntax error, I guess (hope)?
> Relative to the other kind of function that is written like function (x) { return x * 2 }, arrow functions don't define this or arguments in their bodies, instead capturing these values from the environment.<p>In the case of `this`, I can see why they did that: it is the right semantics and all of JavaScript should be this way. But I really think creating two different behaviors for what should all just be syntactic sugar around the same, ol' function values is long-term going to reveal itself as a mistake.<p>But that's just `this`. I can't for the life of me imagine why they also did this for `arguments`.
The author says using arrow functions won't hurt performance, but I wonder if that means v8 knows how to optimize them?<p>Last I checked, using any ES6 syntax causes v8 to permanently deopt the containing function - even using let/const to declare an unused variable that would get removed as dead code. It'll be great once that starts changing..