You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
At the moment, control flow flattening creates a lot of switch statements, which use incremental identifiers and are easy to read.
Describe the solution you'd like
Because of the abundance of switch cases, I suggest turning switch cases with no default case, and simple breaks (where it always breaks at the end of a case and never breaks in the middle) into objects which are then indexed and invoked.
I don't get it. Will not it break the logic of switch?
Switch uses strict equality operator, but in case with object keys, it will works with strings and with numbers.
Also you suggesting to fill whole array with nulls if cases were first 1, and second 10000?
Is your feature request related to a problem? Please describe.
At the moment, control flow flattening creates a lot of switch statements, which use incremental identifiers and are easy to read.
Describe the solution you'd like
Because of the abundance of switch cases, I suggest turning switch cases with no default case, and simple breaks (where it always breaks at the end of a case and never breaks in the middle) into objects which are then indexed and invoked.
Example
gets turned into
This would become even harder to read when combined the pass that changes object keys.
Other optimizations can be made if all case values are constant integers, example:
The setting should probably be called something like
switchIIFEObjects
Describe alternatives you've considered
None
Additional context
None
The text was updated successfully, but these errors were encountered: