Is there a way to find all the functions that call another function? (And then by extension, all the functions that call those functions, etc.)
My guess is it won’t be possible for all cases, but certainly it could be done for most use cases, no? Like if somebody defines their function as:
new Function('a','b', 'return a'+'+b;');
it might be more tricky to find inner references.
Thanks in advance.
There is a arguments.caller but it’s deprecated. Function.caller is replacement but you need function name – I’d use arguments.callee or directly the name.
https://developer.mozilla.org/en/JavaScript/Reference/Functions_and_function_scope/arguments/caller