The descriptions for the depth
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 depth
property above, was that I would get my own call site for depth: 0
, my caller's for depth: 1
, my caller's caller's site for depth: 2
and so on.
But from all I could see, this module completely reverses the call stack with depth: 0
giving the bottommost call site (Node's entry function) and depth: N
the site of the call to caller-callsite
.
In any use-case I can think of, one would need to walk the stack downwards from the function calling caller-callsite
. However, this is extremely awkward to do with the way depth
works currently.
Is there any reason things work as they do now?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too