"Pretty" function expression names

Brendan Eich brendan at mozilla.com
Mon May 4 11:46:52 PDT 2009


On May 4, 2009, at 10:45 AM, P T Withington wrote:

> Assuming we're allowed to speculate on futures here...
>
> I was thinking about improving debug-ability by adding descriptive  
> names to function expressions thusly,
>
>  var myFun = function "my description here" (...) { ... };

Is this better for your purposes than

  var myFun = function (...) { ... };
  myFun.prettyName = "my description here";

/be


>
>
> I.e., be able to use an arbitrary string as the "name" of a function  
> expression.  It seems to me this would be an unambiguous extension,  
> only giving up an unlikely syntax error.  No runtime is required to  
> do anything with the name, although it would be encouraged to make  
> it available as the .name property of the function object.  Comments?
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090504/ff460f06/attachment-0001.html>


More information about the es-discuss mailing list