Skip to content

Commit 1054ec2

Browse files
authored
Merge pull request #42 from bengourley/bengourley/support-at-symbol-functions
Fix parsing of error stacks where url paths contain @ symbols
2 parents 78f860f + 5b539e5 commit 1054ec2

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)