In PHP it is possible to pass the name of a function to another function...
function fail()
{
$query1 = 'SELECT null FROM null;';
$result1 = mysql_query($query1);
if ($result1) {echo 'Reverse-hippies in the code.';}
else {mysql_error_report($query1,mysql_error(),__FUNCTION__);}
}
PHP's __FUNCTION__
magic constant is dynamic, that means when I setup error reporting for any/all queries I don't have to manually copy/paste the name of the function (that would be static); this is especially useful when changing the name of the functions.
Does JavaScript (NOT any frameworks! and not Firebug/other JavaScript debuggers) have this same dynamic functionality built in even in later iterations?