Should enum be hoistable declaration? #18
Replies: 3 comments
-
No, they should not be hoisted. I would like to be able to eventually define decorators on enums and enum members and would rather not have the same surprising semantics as decorators might have on function declarations. Hoisting would also be problematic if you initialized an enum member to the result of an expression. I'd much rather we follow the |
Beta Was this translation helpful? Give feedback.
-
We shouldn’t add new hoisted things to the language. |
Beta Was this translation helpful? Give feedback.
-
Ok. I'll add hoistable declaration as a non-starter. |
Beta Was this translation helpful? Give feedback.
-
Now the EnumDeclaration is a Declaration (like function, class, and const/let).
Should we make it hoistable like function?
Problem
This conflicts with fully computed key (#11), fully computed value (#12), and extend other enums (#5) because it might trigger userland code and have observable side effects.
Beta Was this translation helpful? Give feedback.
All reactions