arguments.callee.name to get function name... does not work?

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

arguments.callee.name to get function name... does not work?

Post by Rudolf »

Code: Select all

mafonctionaffichesonnom: function(){
               console.log('name:'+arguments.callee.name);
        },
bonjour, arguments.callee.name gives nothing here because name should be after function keyword... I expect using an automatic insert for each function, without filling each time a string with the function name,...under php it's well done with:

Code: Select all

self:trace(__function__);
but under javscript, I unsucceed to find a similar trick.

What I see ... is that I have to put

Code: Select all

mafonctionaffichesonnom: function mafonctionaffichesonnom(){
               console.log('name:'+arguments.callee.name);
        },
and with that it's ok... but It's strange that I need to refactor all the names to let it work...
Is there any mean to get the reference name directly?
Post Reply

Return to “Developers”