Hacker News new | ask | show | jobs
by 0xCMP 3651 days ago
Does anyone know if decorators made it in? I can't find them via the search at first glance. I'm guessing they're listed under a different name/section than I thought?
4 comments

"This specification also includes support for a new exponentiation operator and adds a new method to Array.prototype called includes."

These are the only 2 features that made it in..

There are only 2 features this year, and decorators are only a stage 1 proposal, so not likely next year either.

https://github.com/tc39/proposals

I can't find anything related to it. It's literally the only feature I use in ES7, so I hope it is in there. Perhaps it has some other obscure name?
Decorators are not an ES7 feature. They are a stage 1 proposal, which means roughly that the committee agrees this problem space is interesting, but that it might see drastic changes in implementation, syntax, and more, or might not make it into the eventual standard at all.

At this point it is best to call them a Babel feature, not an ES feature.

I do hope they gain some more traction. I've found them to be very useful with reducing boilerplate / repetitive code.
No, and sadly the decorator proposal doesn't even include support for decorators on functions (only classes and methods). This is due to conflicting opinions on how to handle the interaction with function hoisting.