JavaScript: callerName

Published on

/* callerName determines the name of the calling function. */ function callerName() { try { var myCallee = arguments.callee; var hisCallee = myCallee.caller.arguments.callee; var hisCallerName = hisCallee.caller.name; if (isNoE(hisCallerName)) { var hisCallersFunction = hisCallee.caller.toString(); if (!isNoE(hisCallersFunction)) { hisCallerName = fBetween(hisCallersFunction, “function”, “(“); } } hisCallerName = trim(hisCallerName); } catch (e) { hisCallerName = “”; } … Continue reading JavaScript: callerName