Hannes Wallnoefer wrote:
> On Oct 17, 2:46 pm, Marc Guillemot <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> it is quite common to write JavaScript code like this:
>>
>> var foo = function() { ... }
> 
> You can do this:
> 
>   var foo = function foo() { ... }
> 
> It's a bit awkward because you have to type the function name twice,
> but it works.

sure, but only when you work with own sources, ;-(

> 
>> and then to call foo or pass it as parameter to other functions. The
>> drawback while debugging is that the function here is an anonymous
>> function and it is therefore difficult to identify it.
>>
>> What about saving information about the "birth name" of the function to
>> make debugging easier? This would be the name of the variable to which
>> the function was initially assigned.
> 
> I don't think that would be a good idea. It adds complexity to the
> parser and blurs the idea of what a function name is and where it
> comes from.

I've never said that it should replace the function name. I see it as
additional information. The added complexity to the parser wouldn't be
specially high.

Cheers,
Marc.
-- 
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to