Skip to content

Commit 400cad6

Browse files
test(mobile): report the bailout line for diagnostics with details
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a3ca8c4 commit 400cad6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/mobile/src/reactCompilerCoverage.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,16 @@ const sourceFiles = NodeFS.readdirSync(NodePath.join(mobileRoot, "src"), { recur
128128
.map((file) => `src/${file.split(NodePath.sep).join("/")}`)
129129
.sort();
130130

131+
type CompilerLoc = { readonly start?: { readonly line?: number } } | null;
132+
131133
interface CompilerEvent {
132134
readonly kind: string;
133135
readonly detail?: {
134136
readonly options?: {
135137
readonly category?: string;
136138
readonly reason?: string;
137-
readonly loc?: { readonly start?: { readonly line?: number } } | null;
139+
readonly loc?: CompilerLoc;
140+
readonly details?: readonly { readonly loc?: CompilerLoc }[];
138141
};
139142
};
140143
}
@@ -169,7 +172,7 @@ function compilerBailouts(file: string): string[] {
169172
.filter((event) => event.kind === "CompileError" || event.kind === "CompileSkip")
170173
.map(
171174
(event) =>
172-
`line ${event.detail?.options?.loc?.start?.line ?? "?"}: ${event.detail?.options?.category ?? event.kind} ${event.detail?.options?.reason ?? ""}`,
175+
`line ${(event.detail?.options?.loc ?? event.detail?.options?.details?.[0]?.loc)?.start?.line ?? "?"}: ${event.detail?.options?.category ?? event.kind} ${event.detail?.options?.reason ?? ""}`,
173176
);
174177
}
175178

0 commit comments

Comments
 (0)