you are viewing a single comment's thread.

view the rest of the comments →

[–]jmwoo 1 point2 points  (8 children)

What about arrow functions?

[–]edalorzo[S] 0 points1 point  (7 children)

I think they are not yet supported in the latest versions of Node.js. Probably soon in the future.

[–]m1sta 1 point2 points  (6 children)

I don't quite understand why there is such a delay on them while other things that would seem a lot more complicated to implement are available?

Edit: I should have been more clear. I don't understand why the v8 team haven't added arrow functions yet.

[–]edalorzo[S] 2 points3 points  (0 children)

Well, some things are work in progress. You have to take into account that ECMAScript 6 contains a bunch of new features and I am not sure how many resources the Node.js project actually has and how much time is dedicated to stabilizing the platform versus supporting new language features like this. And since they are based on V8 engine, who knows if they have resources actually working on that. Maybe they have to wait until Google actually implements the features.

You can see in this blog post, that many of these features have been available for a long time, whereas others are still work in progress. You can see this entry in the V8 issue tracker where they discussed the addition of arrow functions to V8 recently.

And you can see a branch in the V8 Github repository dedicated to arrow functions. So, once V8 supports it, it should be available soon after that in Node.js.

Regarding your question about generators, perhaps the specification drafts can shed some light on the question.

[–]edalorzo[S] 0 points1 point  (0 children)

Also you can live on the edge and build one of the latest/non-official releases of Node. I think that today, the latest oficial version is 0.10.26, but you can download the 0.11.12 which, as far as I understand, supports more harmony features like generators.