5 PP0027
Neil MacIntosh edited this page 2018-03-05 11:43:42 -08:00

case block containing a throw, return or continue is not yet supported

Abstract evaluation of case blocks that contain a throw, return or continue statement is more complicated than those without. This is especially the case in the presence of branches inside a case block, where one path within the block ends normally and another ends abruptly (return/throw/continue). Prepack needs to take care to ensure that effects from the "normal" end of the case block are separated from those that occur if the block ends abruptly and only emitted to the abstract evaluation at the correct points. Due to this extra complexity, case blocks containing these statements are not yet supported, although abstract evaluation of switch-case statements where all case blocks either fall-through or break is supported.

To work around this limitation, you could enclose the unsupported statements inside a case block within a __residual() function call.