Computed value #12
Jack-Works
started this conversation in
General
Replies: 1 comment 1 reply
-
Why would this be restricted? Values must be able to be symbols, first of all, and i consider #8 to be a requirement. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Should the value be an expression instead of a literal?
Computed value, but restricted
The computed value is very useful when we want to support the bit-flag enum.
We can limit the ability of computed value to only allows the following on the RHS:
-
operator (to allow negative number)~
operator (bit-flag)|
&
<<
>>
>>>
,^
operator (bit-flag)(expr)
to allow specify the priority of computationProblem
The full dynamic computed property value conflicts with inline-able (#4) and hoistable declaration (#18).
The limited version conflicts with Heterogeneous Enum (#8) because you cannot declare an enum member should be a symbol. unless we have some ad-hoc syntax for it.
Beta Was this translation helpful? Give feedback.
All reactions