From 3ebe94f4575efe7c7ef9c23f81f20f0932862acd Mon Sep 17 00:00:00 2001 From: Josh Watzman Date: Tue, 11 Jun 2024 03:15:46 +0100 Subject: [PATCH] Restore fileName to anonymous function names (#84) --- src/utils/process-profile.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/process-profile.ts b/src/utils/process-profile.ts index cb4fac2..26b8aa4 100644 --- a/src/utils/process-profile.ts +++ b/src/utils/process-profile.ts @@ -25,7 +25,10 @@ function adjustCwdPaths(profile: Profile): void { const functionName: string | undefined = profile.stringTable.strings[Number(contextFunction.name)] - if (!(functionName?.includes(':') ?? false)) { + if ( + !functionName?.includes(':') || + functionName?.startsWith('(anonymous') + ) { const fileName: string = profile.stringTable.strings[ Number(contextFunction.filename) ] as string