Decorators on functions

To execute a decorator, you evaluate an expression and doing that prevents hoisting (even for a variable declaration, the right-hand side of an assignment stays put). Therefore, it is not compatible with function declarations being hoisted.

As a work-around, I suggested that function expressions, generator function expressions and arrow functions could be enabled to be decorated:

const func = @someDecorator('abc') (x, y) => { return x + y };

Alas, that wasn’t met with much enthusiasm: Decorators for functions

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)