fix(trace viewer): correctly trim locations on Windows (#29321)

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
This commit is contained in:
Max Schmitt 2024-02-02 18:18:34 +01:00 committed by GitHub
parent ab95aabec5
commit 7d64ca4c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,7 @@ export const ErrorsTab: React.FunctionComponent<{
let longLocation: string | undefined;
const stackFrame = error.stack?.[0];
if (stackFrame) {
const file = stackFrame.file.replace(/.*\/(.*)/, '$1');
const file = stackFrame.file.replace(/.*[/\\](.*)/, '$1');
location = file + ':' + stackFrame.line;
longLocation = stackFrame.file + ':' + stackFrame.line;
}