Buradasın
JavaScript Caller Function Detection Methods
stackoverflow.com/questions/280389/how-do-you-find-out-the-caller-function-in-javascriptYapay zekadan makale özeti
- Deprecated Solutions
- Function.caller is non-standard and should not be used in production
- arguments.caller is deprecated and should be avoided
- Browser-Specific Solutions
- Error.stack property provides full call stack with line numbers
- Browser developer tools offer convenient stack inspection
- console.trace() works in most browsers except IE
- Function Name and Code
- Caller function name can be obtained using caller.toString()
- Caller function code can be retrieved using arguments.callee.caller
- Browser-independent solution available using prepareStackTrace
- Implementation Notes
- Function names must be defined for stack trace legibility
- Some browsers show different information in call stack
- Node.js requires caller-id package instead of Function.caller