for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

Brendan Eich brendan at mozilla.com
Wed Nov 9 15:18:10 PST 2011


On Nov 9, 2011, at 2:43 PM, Axel Rauschmayer wrote:

> Do block-lamdbas count as a fix for the dynamic this problem?

Definitely.


> Or are there other plans to get it solved? I would still love to see that happen, it’s a remarkably subtle source of errors. Could functions adopt the block-lambda semantics of picking up the `this` of the surrounding scope when not invoked as methods? It seems like that could work in strict mode where no one expects `this` to have a value.

No, if you call such functions via object.method() references then this binds to object. You can't break such compatibility only at runtime, and only some of the time.

/be

> 
> -- 
> Dr. Axel Rauschmayer
> axel at rauschma.de
> 
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
> 
> 
> 

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


More information about the es-discuss mailing list