Skip to content

Commit 5b539e5

Browse files
committed
Fix parsing of error stacks where url paths contain @ symbols
1 parent 78f860f commit 5b539e5

File tree

6 files changed

+52
-8
lines changed

6 files changed

+52
-8
lines changed

dist/error-stack-parser.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@
9090
functionName: line
9191
});
9292
} else {
93-
var tokens = line.split('@');
94-
var locationParts = this.extractLocation(tokens.pop());
95-
var functionName = tokens.join('@') || undefined;
93+
var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
94+
var matches = line.match(functionNameRegex);
95+
var functionName = matches && matches[1] ? matches[1] : undefined;
96+
var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));
9697

9798
return new StackFrame({
9899
functionName: functionName,

dist/error-stack-parser.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)