1

Given a Function object, can you get its name as a String? See example:

function doThingWithCallback(callback:Function):void {
   trace("i'm going to run " + callback); // outputs "i'm going to run function Function() { }"
}

function foo():void {
   ...
}

doThingWithCallback(foo);

This example is sort of arbitrary, but it would be very useful to get function names for debugging, particularly when passing around Function objects.

Helen
  • 87,344
  • 17
  • 243
  • 314
paleozogt
  • 6,393
  • 11
  • 51
  • 94

1 Answers1

1

See the best answer to this question.

To my knowledge, the name of a function can only be determined while the function is on the callstack.

Community
  • 1
  • 1
Evan Rogers
  • 768
  • 4
  • 11