This uses the function's runtime name in stack traces, and falls-back to the callsite name only when there is no runtime name. Also, the fallback can be disabled with an option.
We never attempt to map the "enclosing" position's name, because that can give a completely semantically incorrect answer: it can give the name of a different function entirely.
The callsite fallback is still imperfect, but at least the callsite name is one of the names used to refer to the function in sources, even if it's not the function's declared name.
cspotcode
changed the title
Fix #40: get function name from enclosing position, fallback to runtime name, then finally to callsite name
Fix #40: prefer functions' runtime name, fallback to callsite name, w/option to disable fallback
May 8, 2022
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
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.
Fix #40
This uses the function's runtime name in stack traces, and falls-back to the callsite name only when there is no runtime name. Also, the fallback can be disabled with an option.
We never attempt to map the "enclosing" position's name, because that can give a completely semantically incorrect answer: it can give the name of a different function entirely.
The callsite fallback is still imperfect, but at least the callsite name is one of the names used to refer to the function in sources, even if it's not the function's declared name.