Repository navigation
Yes, Fat Arrows are still broken #1655
Description
Activity
- added a commit that references this issue
on May 7, 2015 Does this need to remain open to be used as a reference?
Fat Arrows are still broken
Yeeep.
Does this need to remain open to be used as a reference?
I don't think so. Closing, hopefully people will search it. :)
Not blocked any more. It will will be shipped with Chrome 45 https://twitter.com/malyw/status/608943596918702080. However according to https://kangax.github.io/compat-table/es6/ support is still lacking for lexical "super" binding and lexical "new.target" binding.
@friday: That's because
new.targetdoesn't work in Chrome at all without flags (so it cannot work with arrows, because it doesn't even work outside of those), and lexical "super" binding is here, but classes require strict mode in Chrome for some reason (this is problem with classes, not arrow functions).Would say it's implemented.
Thanks for clearing out the confusion @xfix :)
Now arrow functions are shipped in V8. When can we expect them in iojs?
Now arrow functions are shipped in V8.
No not quite. They aren't in a stable v8 yet afaik (they are in 4.5). The latest stable is 4.4 -- anything can happen before then.
@Fishrock123 Oh right! I forgot they shipped it in the latest Chrome Beta, not the stable. My bad!
It would be nice to have a beta build of iojs that uses the beta v8 branch.
+1 on beta builds with latest v8. It would also be awesome to have documentation in iojs about which v8 options actually have an implementation exposed. For example, it's very misleading to have
--harmony_moduleswhen enabling yields no benefits whatsoever to the developer.We are getting to the point in the server side where transpilation may not be necessary to have your es2015+ cake and eat it too. But without more clarity on where the line is drawn for a particular release, it's a game of enabling the flag, getting an error, then hunting down the version of v8 that iojs is using, then searching for the latest features in v8, then looking back in the history to see if/when it was implemented, etc etc.
The V8 API changes frequently and is often broken in development. Maintaining a working build of io.js would be a a big time sink for little gain. Few people run unstable releases in any serious capacity and bug reports would be mostly useless because of the ever moving target.
Are some harmony flags blocked in iojs? Using this command:
node --es_staging --harmony_arrow_functions server.jsresults in this error:
SyntaxError: Unexpected token =>This is why it would be great to know the status of each harmony flag for the current release of iojs, so that it's easy to understand what can be experimented with and what can't. Running
iojs --v8-options | grep "in progress"gives you a list, but its just misleading. Like I said in the previous post, theharmony_modulesis on the list, but I don't think it can be used in any shape or form. Or can it? I don't know; maybe I'm doing something wrong here.@sjmueller A good place to go for a list of supported features is kangax's compatibility table: https://kangax.github.io/compat-table/es6/#iojs.
There you see that arrow functions are not available in io.js. To have an idea of what will probably be in the next major version, you can look at the column for the current beta of Chrome (CH 45)This is why it would be great to know the status of each harmony flag for the current release of iojs, so that it's easy to understand what can be experimented with and what can't.
That's a fair bit to keep track of haha, are you volunteering? The official way right now is "go try it". :P
Arrow Functions are coming in V8 4.5 though! https://www.chromestatus.com/feature/5047308127305728
That roughly translates to "should be in node 5.0.0 in october". :)
(End of Aug/early sept: node 4.0.0, Oct: 4.0.0 LTS, node 5.0.0, 2016 April: node 6, 2016 oct: node 7, etc...)
- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
on Aug 23, 2015 @Fishrock123 @targos I understand how it could be a fair amount of work, especially since the answer isn't a binary one. Usually the feature is behind a flag because it's x% done, so quantifying that every release would be cumbersome.
Perhaps there's a simpler way to get the message to folks who want to play around. So going back to
--harmony_modules, I enabled it and got the error, then asked myself am i doing it wrong?. So then I google it, and stackoverflow says it was enabled on node 0.12 half a year ago. So I think, iojs is more advanced than node with modern ver of v8, so i must be doing it wrong. I guess that is where the confusion comes in.So let's start the list then. I'll fill in a few:
iojs 3.1 --harmony_modules (unavailable) --harmony_arrays (partial) --harmony_array_includes (?) --harmony_regexps (?) --harmony_arrow_functions (unavailable) --harmony_proxies (?) --harmony_sloppy (partial) --harmony_unicode_regexps (?) --harmony_reflect (?) --harmony_destructuring (?) --harmony_object (?)Guys, chrome 45 just released, and according to chromestatus, they are in it. Which means that it's stable now, it'd be nice to have them in iojs
Yes, and all the Arrow Functions issues have been closed
v8 with arrow functions is in #2632
(Tracking issue to save time for the curious and those they'd otherwise hound.)
Developers champing at the bit for native fat arrows? Worried about them being hidden behind a flag? Hounded by that one developer who insists they tried it and it's fine? Worried about the ominous warnings on the ES6 on io.js page?
Your first stop should be V8 issue 2700. Check to see if it's blocked (left column, just above "add a comment"):
v8 4.2.77.18 in io.js 2.0.0 still has trouble with:
super()from an arrow function crashes the enginesuper.xfrom an arrow function throwsReferenceErrorIf you need fat arrows, consider transpilation.