diff --git a/src/aggregrate-errors.js b/src/aggregrate-errors.js index 2527e8d..a94e531 100644 --- a/src/aggregrate-errors.js +++ b/src/aggregrate-errors.js @@ -114,7 +114,10 @@ function removeInternalFrames(stack) { let internalBasePath = getInternalBasePath(); return stack.filter((frame) => { - return (!frame.location.path.startsWith(internalBasePath)); + return ( + !frame.location.anonymous + && !frame.location.path.startsWith(internalBasePath) + ); }); } diff --git a/src/parse-stacktrace.js b/src/parse-stacktrace.js index c3ab138..9c1e8bb 100644 --- a/src/parse-stacktrace.js +++ b/src/parse-stacktrace.js @@ -18,16 +18,20 @@ function maybeTrim(value) { } function parseLocation(locationString) { - let match = positionRegex.exec(locationString); - - if (match != null) { - return { - path: match[1], - line: parseInt(match[2]), - column: parseInt(match[3]) - }; + if (locationString === "") { + return { anonymous: true }; } else { - throw new Error(`Could not parse location from string: ${locationString}`); + let match = positionRegex.exec(locationString); + + if (match != null) { + return { + path: match[1], + line: parseInt(match[2]), + column: parseInt(match[3]) + }; + } else { + throw new Error(`Could not parse location from string: ${locationString}`); + } } }