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 {
21
21
} ;
22
22
}
23
23
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
+
24
43
/**
25
44
* Takes a V8 Error#stack string and extracts source position information.
26
45
*
@@ -79,7 +98,8 @@ export function parseSourcePositionsFromErrorStack(
79
98
80
99
const linkCandidate = line . substring ( left , right ) ;
81
100
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 ) {
83
103
if ( linkInfos . length && linkInfos [ linkInfos . length - 1 ] . isCallFrame && ! linkInfos [ linkInfos . length - 1 ] . link ) {
84
104
// Combine builtin frames.
85
105
linkInfos [ linkInfos . length - 1 ] . line += `\n${ line } ` ;
You can’t perform that action at this time.
0 commit comments