File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,25 @@ export interface ParsedErrorFrame {
2121 } ;
2222}
2323
24+ export type SpecialHermesStackTraceFrameTypes = 'native' | 'address at' | 'empty url' ;
25+
26+ function getSpecialHermesStackTraceFrameType ( {
27+ url,
28+ } : {
29+ url : Platform . DevToolsPath . UrlString ,
30+ } ) : SpecialHermesStackTraceFrameTypes | null {
31+ if ( url === 'native' ) {
32+ return 'native' ;
33+ }
34+ if ( url === '' ) {
35+ return 'empty url' ;
36+ }
37+ if ( url . startsWith ?.( 'address at ' ) ) {
38+ return 'address at' ;
39+ }
40+ return null ;
41+ }
42+
2443/**
2544 * Takes a V8 Error#stack string and extracts source position information.
2645 *
@@ -79,7 +98,8 @@ export function parseSourcePositionsFromErrorStack(
7998
8099 const linkCandidate = line . substring ( left , right ) ;
81100 const splitResult = Common . ParsedURL . ParsedURL . splitLineAndColumn ( linkCandidate ) ;
82- if ( splitResult . url === '<anonymous>' || splitResult . url === 'native' ) {
101+ const specialHermesFrameType = getSpecialHermesStackTraceFrameType ( splitResult ) ;
102+ if ( splitResult . url === '<anonymous>' || specialHermesFrameType !== null ) {
83103 if ( linkInfos . length && linkInfos [ linkInfos . length - 1 ] . isCallFrame && ! linkInfos [ linkInfos . length - 1 ] . link ) {
84104 // Combine builtin frames.
85105 linkInfos [ linkInfos . length - 1 ] . line += `\n${ line } ` ;
You can’t perform that action at this time.
0 commit comments