Skip to content

Cover both reported Chrome anonymous function stacktrace lines #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 26, 2014

Conversation

juriejan
Copy link
Contributor

The fix in #290 broke the fix in #238. This PR covers both cases. Not sure if it's the most elegant solution, but it's the best I could do within a limited time frame.

@juriejan juriejan changed the title Altered Chrome stacktrace line regular expression to cover both reported... Cover both reported Chrome anonymous function stacktrace lines Nov 22, 2014
gecko = /^\s*(.*?)(?:\((.*?)\))?@((?:file|https?|chrome).*?):(\d+)(?::(\d+))?\s*$/i,
lines = ex.stack.split('\n'),
stack = [],
parts,
element,
func,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you added this.

@juriejan
Copy link
Contributor Author

Thought I was missing something obvious. Fixed as per comments.

@@ -651,7 +651,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
} else if ((parts = chrome.exec(lines[i]))) {
element = {
'url': parts[2],
'func': parts[1] || UNKNOWN_FUNCTION,
'func': (parts[1] || UNKNOWN_FUNCTION),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These added parens are now unnecessary too.

Everything else looks good. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops!

@mattrobenolt
Copy link
Contributor

Awesome. Thanks! 🍰 ✨

mattrobenolt added a commit that referenced this pull request Nov 26, 2014
Cover both reported Chrome anonymous function stacktrace lines
@mattrobenolt mattrobenolt merged commit 944d9f5 into getsentry:master Nov 26, 2014
@juriejan juriejan deleted the chrome-regex-for-anon branch February 3, 2015 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants