Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
Neil MacIntosh edited this page Mar 5, 2018 · 5 revisions

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.

Clone this wiki locally