The name of the calling function can be obtained via the deprecated arguments.callee.caller.name property MDN: arguments.callee.
Another method is by parsing the value of new Error().stack.
In Chrome you can use:
var stackTrace = {}:;
Error.captureStackTrace(stackTrace); // Get the stack trace
stackTrace = stackTrace.stack; // Formatted string