[ez] Update completed todo comment
lol at how out of date this comment is :-)
Joe Savona committed
Jun 5, 2023 at 16:46 UTC
04d6bad1aee7cc0d503f9ea36022c9af87a9907a
1 file changed
+7
-9
compiler/forget/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts
+7
-9
@@ -46,15 +46,13 @@ import HIRBuilder, { Bindings } from "./HIRBuilder";
46
// *******************************************************************************************
47
48
/**
49
- * Lower a function declaration into a control flow graph that models aspects of
50
- * control flow that are necessary for memoization. Notably, only control flow
51
- * that occurs at statement granularity is modeled (eg `if`, `for`, `return`
52
- * statements), not control flow at the expression level (ternaries or boolean
53
- * short-circuiting). Throw semantics are also not modeled: in general exceptions
54
- * are treated as exceptional conditions that invalidate memoization.
55
- *
56
- * TODO: consider modeling control-flow at expression level for even more fine-
57
- * grained reactivity.
49
+ * Converts a function into a high-level intermediate form (HIR) which represents
50
+ * the code as a control-flow graph. All normal control-flow is modeled as accurately
51
+ * as possible to allow precise, expression-level memoization. The main exceptions are
52
+ * try/catch statements and exceptions: we currently bail out (skip compilation) for
53
+ * try/catch and do not attempt to model control flow of exceptions, which can occur
54
+ * ~anywhere in JavaScript. The compiler assumes that exceptions will be handled by
55
+ * the runtime, ie by invalidating memoization.
56
*/
57
export function lower(
58
func: NodePath<t.Function>,