File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -112,18 +112,12 @@ export const node: StackLineParser = (line: string) => {
112
112
// see https://github.com/getsentry/raven-node/issues/176
113
113
const in_app = ! isInternal && filename !== undefined && ! filename . includes ( 'node_modules/' ) ;
114
114
115
- /** Gets int from string or undefined if NaN */
116
- function getInt ( int : string ) : number | undefined {
117
- const val = parseInt ( int , 10 ) ;
118
- return isNaN ( val ) ? undefined : val ;
119
- }
120
-
121
115
return {
122
116
filename : lineMatch [ 2 ] ,
123
117
module : getModule ( filename ) ,
124
118
function : fn ,
125
- lineno : getInt ( lineMatch [ 3 ] ) ,
126
- colno : getInt ( lineMatch [ 4 ] ) ,
119
+ lineno : parseInt ( lineMatch [ 3 ] , 10 ) || undefined ,
120
+ colno : parseInt ( lineMatch [ 4 ] , 10 ) || undefined ,
127
121
in_app,
128
122
} ;
129
123
} ;
Original file line number Diff line number Diff line change @@ -40,24 +40,6 @@ describe('Stack parsing', () => {
40
40
expect ( frames [ last - 2 ] . function ) . toEqual ( 'eval' ) ;
41
41
} ) ;
42
42
43
- test ( 'parses with zero row/col' , ( ) => {
44
- const err : { [ key : string ] : any } = { } ;
45
- err . stack = 'Error: Foo\n' + ' at Timer.listOnTimeout [as ontimeout] (timers.js:0:0)\n' ;
46
-
47
- const frames = extractStackFromError ( err as Error ) ;
48
-
49
- expect ( frames ) . toEqual ( [
50
- {
51
- filename : 'timers.js' ,
52
- module : 'timers' ,
53
- function : 'Timer.listOnTimeout [as ontimeout]' ,
54
- lineno : 0 ,
55
- colno : 0 ,
56
- in_app : false ,
57
- } ,
58
- ] ) ;
59
- } ) ;
60
-
61
43
test ( 'parses object in fn name' , ( ) => {
62
44
const err : { [ key : string ] : any } = { } ;
63
45
err . stack =
You can’t perform that action at this time.
0 commit comments