with and scope chain augmentation

David-Sarah Hopwood david-sarah at jacaranda.org
Tue Jun 23 13:15:14 PDT 2009


Mike Wilson wrote:
> Watching the "Changes to JavaScript, Part 1: EcmaScript 5"
> http://www.youtube.com/watch?v=Kq4FpMe6cRs
> I came to think of augmented scope chains for DOM0 event 
> handlers.
> 
> I sympathize with the slide "Problem: Can't emulate 
> platform objects" (which is addressed by e g getter/setter
> properties), but the removal of with(){} in ES5 strict mode
> would mean it gets harder to emulate the scope chain 
> augmentation done by browsers?

The 'with' can be in non-strict code, which is perfectly
adequate for implementing a backward-compatible misfeature
(the peculiar scope chain of a DOM0 event handler).

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com




More information about the es5-discuss mailing list