Can I suggest that allowing writing to name may be helpful when creating transparent wrapper functions?

We do a lot of this:

function wrapWithChangeNotification(key, fn)
{
        return function()
        {
                this.willChangeValueForKey(key);
                var result= fn.apply(this, arguments);
                this.didChangeValueForKey(key);
                return result;
        }
}

I'd love it if I could set the name on the new function to match the original function.

On 4 Mar, 2009, at 1:17 PM, Brendan Eich wrote:

Why in the world is name writable?

js> function f(){}
js> f.name
f
js> f.name = 'g'
g
js> f.name
f


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

Reply via email to