A new function name property proposal

Jorge Chamorro Bieling jorge at jorgechamorro.com
Mon Nov 19 11:29:59 PST 2012


On 17/11/2012, at 18:45, Brandon Benvie wrote:

> The name property doesn't currently (and the I don't propose it should) have a correlation to the name in scope. In function declarations the name is only in scope because its declared in the outer scope, and this can be overwritten permanently rendering the name unusable in that scope. A named function expression

--and function declarations too--

> puts the name association in a decorative scope that is untouchable and only accessible inside the function.

It's not clear to me whether one might end with function whose name (the value returned by function.name) might be !== than its name as "seen" from inside the function itself:

function ƒ () { return (ƒ.name !== 'ƒ') }

?
-- 
Jorge.


More information about the es-discuss mailing list