@@ -27,6 +27,11 @@ export type SpecialHermesStackTraceFrameTypes =
27
27
// for the frame so that a debugger could stitch together a
28
28
// hybrid cross-language call stack
29
29
'native' |
30
+ // e.g "(eval:1:2)"- Seem to be reported when there's a
31
+ // ReferenceError or TypeError during the initial bundle code execution.
32
+ // TODO: Understand exactly where these originate from and what further work
33
+ // should be done in regards to them
34
+ 'eval' |
30
35
// e.g "(:3:4)"- Frames with empty url
31
36
// TODO: Seems to be happening due to a bug that needs to be investigated
32
37
// and produce an actual script URL instead
@@ -44,6 +49,10 @@ function getSpecialHermesFrameBasedOnURL(url: string): SpecialHermesStackTraceFr
44
49
return 'native' ;
45
50
}
46
51
52
+ if ( url === 'eval' ) {
53
+ return 'eval' ;
54
+ }
55
+
47
56
if ( url === '' ) {
48
57
return 'empty url' ;
49
58
}
@@ -89,7 +98,7 @@ export function parseSourcePositionsFromErrorStack(
89
98
if ( ! match ) {
90
99
if ( linkInfos . length && linkInfos [ linkInfos . length - 1 ] . isCallFrame ) {
91
100
const specialHermesFrameType = getSpecialHermesFrameBasedOnLine ( line ) ;
92
- if ( specialHermesFrameType ) {
101
+ if ( specialHermesFrameType !== null ) {
93
102
specialHermesFramesParsed . add ( specialHermesFrameType ) ;
94
103
if ( ! linkInfos [ linkInfos . length - 1 ] . link ) {
95
104
// Combine builtin frames.
@@ -136,7 +145,7 @@ export function parseSourcePositionsFromErrorStack(
136
145
const linkCandidate = line . substring ( left , right ) ;
137
146
const splitResult = Common . ParsedURL . ParsedURL . splitLineAndColumn ( linkCandidate ) ;
138
147
const specialHermesFrameType = getSpecialHermesFrameBasedOnURL ( splitResult . url ) ;
139
- if ( specialHermesFrameType ) {
148
+ if ( specialHermesFrameType !== null ) {
140
149
specialHermesFramesParsed . add ( specialHermesFrameType ) ;
141
150
}
142
151
0 commit comments