@@ -6,6 +6,7 @@ import * as Common from '../../core/common/common.js';
66import type * as Platform from '../../core/platform/platform.js' ;
77import type * as SDK from '../../core/sdk/sdk.js' ;
88import type * as Protocol from '../../generated/protocol.js' ;
9+ import * as Host from '../../core/host/host.js' ;
910
1011export interface ParsedErrorFrame {
1112 line : string ;
@@ -43,6 +44,7 @@ export function parseSourcePositionsFromErrorStack(
4344 const match = / ^ \s * a t \s ( a s y n c \s ) ? / . exec ( line ) ;
4445 if ( ! match ) {
4546 if ( linkInfos . length && linkInfos [ linkInfos . length - 1 ] . isCallFrame ) {
47+ Host . rnPerfMetrics . stackTraceSymbolicationFailed ( stack , line , '"at (url)" not found' ) ;
4648 return null ;
4749 }
4850 linkInfos . push ( { line} ) ;
@@ -59,6 +61,7 @@ export function parseSourcePositionsFromErrorStack(
5961 do {
6062 left = line . indexOf ( ' (' , left ) ;
6163 if ( left < 0 ) {
64+ Host . rnPerfMetrics . stackTraceSymbolicationFailed ( stack , line , 'left "(" not found' ) ;
6265 return null ;
6366 }
6467 left += 2 ;
@@ -68,6 +71,7 @@ export function parseSourcePositionsFromErrorStack(
6871 left += 8 ;
6972 right = line . lastIndexOf ( ', ' , right ) - 1 ;
7073 if ( right < 0 ) {
74+ Host . rnPerfMetrics . stackTraceSymbolicationFailed ( stack , line , 'right "(" not found' ) ;
7175 return null ;
7276 }
7377 } while ( true ) ;
@@ -89,6 +93,7 @@ export function parseSourcePositionsFromErrorStack(
8993 url = parseOrScriptMatch ( debuggerModel , Common . ParsedURL . ParsedURL . completeURL ( baseURL , splitResult . url ) ) ;
9094 }
9195 if ( ! url ) {
96+ Host . rnPerfMetrics . stackTraceSymbolicationFailed ( stack , line , 'url parsing failed' ) ;
9297 return null ;
9398 }
9499
0 commit comments