Brendan Eich schreef:
http://wiki.ecmascript.org/doku.php?id=strawman:name_property_of_functions

I did not reproduce all the details from the thread, but I tried to capture the essential points. Please point out omissions and errors. Thanks,

What I’m missing about Function.name is that you can only specify it using function literals (at least, currently in Firefox I think that is the case). It would be nice if you could also either set this with either the Function constructor, or after the object has been created.

This is functionality that is currently missing, so that function constructors are second-class citizens compared to function literals. (By the way, while you’re at it, it would be nice if the constructor also allowed closures to be specified, because that is also something functions created with the Function constructor unfortunately cannot do).

Also, it would be nice if when a function is declared as follows:

yyy.xxx = function() { … }

yyy = { xxx: function() { … } }

That in both these cases the function’s name property would be ‘xxx’ as well.

Both these would aid debuggability of functions. Currently we have code that looks like this to aid stack trace debugging:

xx.core.Events.createEvent = function xx_core_Events_createEvent() { … }

This makes the function show up with the name ‘xx_core_Events_createEvent()’ instead of ‘anonymous()’ in Firebug, which I guess is an improvement, but I think this is a terribly ugly way to go about it :). So it would be nice if I could just leave the name out and it would still show up as ‘createEvent()’ (I can make do without the xx.core.Events part).

~Laurens

--
Note: New email address! Please update your address book.

~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, student, Utrecht University, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com

begin:vcard
fn:Laurens Holst
n:Holst;Laurens
email;internet:[email protected]
version:2.1
end:vcard

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to