Last 12 weeks · 0 commits
4 of 6 standards met
Repository: sindresorhus/caller-callsite. Description: Get the callsite of the caller function Stars: 54, Forks: 10. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v6.0.0 (5mo ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 85%. Top contributors: sindresorhus, dideler, BendingBender, LitoMore, Richienb, tomhughes, yaodingyd.
The descriptions for the property reads: The callsite depth, meaning how many levels we follow back on the stack trace. The topmost item on the call stack ist the currently executing function, if I go one item back, or lower, I will find the stack frame of my caller, then my caller's caller, and so on. So my expectation, which was also corroborated by the description of the property above, was that I would get my own call site for , my caller's for , my caller's caller's site for and so on. But from all I could see, this module completely reverses the call stack with giving the bottommost call site (Node's entry function) and the site of the call to . In any use-case I can think of, one would need to walk the stack _downwards_ from the function calling . However, this is extremely awkward to do with the way works currently. Is there any reason things work as they do now?