Re: get object name from within object



Lasse Reichstein Nielsen wrote:
<snip>
> Still, arguments.callee is the only way to access the
> current function without knowing its name. It's just that
> it only works inside that function, and at that point,
> you should know the name.

Which means that the only circumstances where arguments.callee would be
necessary is when the function is anonymous (the result of an anonymous
function expression or the use of the Function constructor, but only
sometimes), or when the author has (rather stupidly) re-used the
function's name as a formal parameter, local variable or inner function
name and so masked the property on the scope chain that refers to the
function itself.

Richard.


.



Relevant Pages

  • Re: If You Were at Adam & Eves Position
    ... naive, not knowing what evil is, and would have no way of knowing the ... This would be true if, like modern Man, Adam could directly observe only the ... reaching teh essences only by philosophical reasoning. ...
    (soc.religion.christian)
  • Re: CiderPress v3.0.0 released
    ... useful to warrant registration. ... I've had a lot of fun working on it ... and knowing that my work is appreciated helps immensely. ...
    (comp.sys.apple2)
  • Re: Ive heard of
    ... absinthe at a party, not knowing what it was or what would happen to him. ...
    (uk.people.support.depression)
  • Re: pointer
    ... It allows you (amongst other things) to write code that calls a ... function without knowing that function by name. ...
    (comp.lang.c)
  • Re: Lawful Stupid
    ... Between saving the world and having a spot of tea Matt Frisch said ... > I don't buy the whole knowing them well bit. ...
    (rec.games.frp.dnd)

Loading