sindresorhus / caller-callsite Goto Github PK
View Code? Open in Web Editor NEWGet the callsite of the caller function
License: MIT License
Get the callsite of the caller function
License: MIT License
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?
This module has the same problem: sindresorhus/caller-path#2
node_modules\caller-callsite\index.js
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.