![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.javascript archiveRe: get object name from within object
From: Lasse Reichstein Nielsen <lrn@hotpop.com>
Date: Sat Jul 23 2005 - 11:07:02 CEST
"VK" <schools_ring@yahoo.com> writes:
> warteschlange wrote:
>> function coffee(){
Possible, but why bother when you can just use the string "coffee",
>>
Impossible.
...
Here you find the name of arguments.callee ...
> if (arguments.caller) {
and here you look that name up. As usual, the use of eval is
However, since you guard this with
In any case, arguments.caller and func.caller are not part of the
> function getObjectName(obj) {
This can error if the obj is a function from a function expression,
Still, arguments.callee is the only way to access the current function
-- Lasse Reichstein Nielsen - lrn@hotpop.com DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.'Received on Tue Oct 18 03:00:17 2005 |