- Joined
- Sep 15, 2012
- Messages
- 102
- Reaction score
- 60
- First Language
- Portuguese
Hi everyone!
I'm trying something with no success
Let's look at the function, for example:
Game_Actor.prototype.isActor = function() {
return true;
};
I want to know the name of the function who called this one:
So I looked up and it seems that what I need is "arguments.callee.caller.name" so:
var alias = Game_Actor.prototype.isActor
Game_Actor.prototype.isActor = function() {
alias.call(this);
console.log(arguments.callee.caller.name);
};
but then I can't access the name!! nothing appears
I can access the arguments.callee.caller (it will return the code inside the function) but nothing more!!
Some help, here?!
I'm trying something with no success
Let's look at the function, for example:
Game_Actor.prototype.isActor = function() {
return true;
};
I want to know the name of the function who called this one:
So I looked up and it seems that what I need is "arguments.callee.caller.name" so:
var alias = Game_Actor.prototype.isActor
Game_Actor.prototype.isActor = function() {
alias.call(this);
console.log(arguments.callee.caller.name);
};
but then I can't access the name!! nothing appears
Some help, here?!