@@ -17,17 +17,19 @@ export type CatchEvidence = {
1717 /** The clause contains a `throw`. */
1818 rethrows : boolean ;
1919 /**
20- * The clause picks what to do from what it caught: an `if`, a `switch`, or a conditional that is
21- * the whole `return`/`throw`. An `instanceof` used only to word a message,
22- * `json({ error: e instanceof Error ? e.message : String(e) })`, does not count: every error
23- * still leaves by the same path.
20+ * The clause picks what to do from what it caught: an `if` or `switch` whose condition references
21+ * the caught error binding, or a conditional that is the whole `return`/`throw`. `if (retries > 0)`
22+ * does not count, and a bindingless `catch { ... }` cannot count at all. An `instanceof` used only
23+ * to word a message, `json({ error: e instanceof Error ? e.message : String(e) })`, does not
24+ * count either: every error still leaves by the same path.
2425 */
2526 branches : boolean ;
2627 /**
2728 * The guarded region parses something: `JSON.parse`, `request.json()`, a zod `parse`/`safeParse`,
2829 * a `decode`, or a `new URL`/`URLSearchParams`/`RegExp`. Those three constructors are read here
29- * because constructors never appear in `calleeTexts`; other constructors do not count, or every
30- * `new SomePresenter()` in a try would excuse its catch.
30+ * because a `new` expression is not a call, so the call-callee scan that feeds this check never
31+ * sees them; other constructors do not count, or every `new SomePresenter()` in a try would excuse
32+ * its catch.
3133 */
3234 guardsParse : boolean ;
3335 /** Statements in the guarded try block, counted as `statementCount` counts them. */
@@ -38,9 +40,7 @@ export type CatchEvidence = {
3840export type LogCall = {
3941 /** Full callee path, e.g. `logger.error`. */
4042 callee : string ;
41- /** Whether an object literal was passed as an argument. */
42- hasObjectArgument : boolean ;
43- /** Property names on that object literal, e.g. `["environmentId", "error"]`. */
43+ /** Property names on the first object-literal argument, e.g. `["environmentId", "error"]`. */
4444 fields : string [ ] ;
4545 /** Whether the call sits inside a catch clause, i.e. on the failure path. */
4646 inCatch : boolean ;
@@ -58,12 +58,6 @@ export type EntryPoint = {
5858 importedNames : string [ ] ;
5959 /** Names of functions called inside the loader/action bodies, or in a same-file helper they call. */
6060 calleeNames : string [ ] ;
61- /**
62- * The same calls as `calleeNames`, same order and same length, but as the whole callee path:
63- * `prisma.organization.findFirst` where `calleeNames` has `findFirst`. A path that runs through
64- * something unnameable (`new PromptService().createOverride`) falls back to the bare name.
65- */
66- calleeTexts : string [ ] ;
6761 /**
6862 * Whether a `try` appears in the loader/action bodies, or in a same-file helper they call. Note
6963 * that this says a `try`, not a catch: a `try`/`finally` sets it while `catches` stays empty and
@@ -72,26 +66,6 @@ export type EntryPoint = {
7266 hasTryCatch : boolean ;
7367 /** One entry per catch clause in those bodies, in source order. */
7468 catches : CatchEvidence [ ] ;
75- /**
76- * Whether any catch clause in those bodies contains a `throw`. A catch that rethrows has decided
77- * the error is not its to answer, which is a different act from swallowing it. Aggregate of
78- * `catches`, kept so existing consumers keep working.
79- */
80- catchRethrows : boolean ;
81- /**
82- * Whether any catch clause in those bodies branches on the error: an `if`, a `switch`, or an
83- * `instanceof`. With `catchRethrows` both false while `hasTryCatch` is true, every catch in the
84- * entry point takes one path out regardless of what was thrown.
85- */
86- catchBranches : boolean ;
87- /**
88- * Whether every catch in those bodies guards a specific operation rather than the handler: the
89- * entry point has at least one catch clause, and no try block with a catch holds more than two
90- * statements. The `try { body = await request.json() } catch { 400 }` idiom, which takes one path
91- * out and is still deliberate. False when any catch wraps the bulk of a body, and false when
92- * there is no catch clause at all.
93- */
94- catchesNarrowly : boolean ;
9569 /** Calls to a `logger.*` or `log.*` callee in those bodies, in source order. */
9670 logCalls : LogCall [ ] ;
9771 /**
0 commit comments