Skip to content

Commit e060c3c

Browse files
committed
no zero
1 parent 224090c commit e060c3c

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

packages/node/src/stack-parser.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,12 @@ export const node: StackLineParser = (line: string) => {
112112
// see https://github.com/getsentry/raven-node/issues/176
113113
const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');
114114

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-
121115
return {
122116
filename: lineMatch[2],
123117
module: getModule(filename),
124118
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,
127121
in_app,
128122
};
129123
};

packages/node/test/stacktrace.test.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ describe('Stack parsing', () => {
4040
expect(frames[last - 2].function).toEqual('eval');
4141
});
4242

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-
6143
test('parses object in fn name', () => {
6244
const err: { [key: string]: any } = {};
6345
err.stack =

0 commit comments

Comments
 (0)