Skip to content

Commit 386b80b

Browse files
committed
Remove unnecessary try catch
1 parent 93e0293 commit 386b80b

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

packages/node/src/stack-parser.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,6 @@ export const node: StackLineParser = (line: string) => {
8787
functionName = undefined;
8888
}
8989

90-
let fn;
91-
try {
92-
fn = functionName || `${typeName}.${methodName || '<anonymous>'}`;
93-
} catch (_) {
94-
// This seems to happen sometimes when using 'use strict',
95-
// stemming from `getTypeName`.
96-
// [TypeError: Cannot read property 'constructor' of undefined]
97-
fn = '<anonymous>';
98-
}
99-
10090
const filename = lineMatch[2];
10191
const isNative = lineMatch[5] === 'native';
10292
const isInternal =
@@ -110,7 +100,7 @@ export const node: StackLineParser = (line: string) => {
110100
return {
111101
filename,
112102
module: getModule(filename),
113-
function: fn,
103+
function: functionName || `${typeName}.${methodName || '<anonymous>'}`,
114104
lineno: parseInt(lineMatch[3], 10) || undefined,
115105
colno: parseInt(lineMatch[4], 10) || undefined,
116106
in_app,

0 commit comments

Comments
 (0)