Function Expression/Declaration Decorators
adam.arthur.wilson at gmail.com
Fri Nov 18 18:45:23 UTC 2016
I've already read through the significant prior discussion on the
difficulties of supporting decorators for function declarations. I'm not
trying to rehash that here!
>From a real world readability perspective, I think it's a big mistake to
disallow decorating hoisted functions. For example, when returning an
object with attached functions, it's much easier to read if the export
object is at the top, with the implementation details below (think object
creation functions, angular 1 services). In fact with well named functions
putting the implementation front and center impedes readability, since
people tend to understand functions better when they read them breadth
first with implementation details abstracted (function declared below
return, only have to be aware of one context, one scope).
Anyway, I don't want to rant about it. I did stumble across this Stage 0
proposal (https://goo.gl/8MmCMG) by Igor Minar, and supposedly working with
Yehuda Katz, on allowing decorators for function expressions and
declarations through Mirrors (a separate proposal).
Does anyone know the status of this and the corresponding Mirrors proposal?
Having issues digging up information. Planning to work on a new proposal if
nothing's in motion.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss