Repository navigation
fix: parse anonymous frame paths with parens and strip async prefix - #77
Open
chiragbitoni wants to merge 1 commit into
Open
chiragbitoni wants to merge 1 commit into
chiragbitoni wants to merge 1 commit into
Conversation
Fix parseLine incorrectly treating paths containing ' (' as function
names in anonymous stack frames that lack closing parentheses. Also
strip leading 'async ' from anonymous and named async frames.
Fixes tapjs#76.
Signed-off-by: Chirag Bitoni <chiragbitoni4994@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
StackUtils.prototype.parseLine:((such asat /home/me/My App (beta)/index.js:4:11orat C:\\Program Files (x86)\\app\\index.js:4:11), the regex group(?:(.*?) \()?matched the path prefix before(as a function name because(\)?)$'allowed an empty string when no closing)was present. In V8, call locations are only enclosed in parentheses if preceded by a function name, so when no closing parenthesis is present at the end of the line, the frame is anonymous and any(is part of the file path.async(e.g.at async /home/me/app/index.js:4:11orat async foo (/home/me/app/index.js:4:11)). Previously,asyncwas kept infilefor anonymous async frames. Adding(?:async )?strips this marker sofilereceives the clean file path and named async frames extract the clean function name matchingCallSite#getFunctionName().Fixes #76.
Changes
reinindex.jsto strip leading(?:async )?.parseLine, recombinedfnameandfilewhen!closeParen && fnameoccurs (retaining the full path and leavingfunctionundefined).test/test.jscovering anonymous paths with parens, Windows paths with(x86), and async anonymous & named frames.