Unscopeable

Erik Arvidsson erik.arvidsson at gmail.com
Wed Aug 21 07:02:24 PDT 2013


Here is a proof of concept using Proxy (Spidermonkey only)

http://jsbin.com/AWIs/2/edit

It rewrites the `with (expr)` with `with (createUnscopeable(expr))`
where createUnscopeable returns a proxy that filters out the black
listed property names.

On Wed, Aug 21, 2013 at 9:42 AM, Andreas Rossberg <rossberg at google.com> wrote:
> On 21 August 2013 15:18, Peter van der Zee <ecma at qfox.nl> wrote:
>> Can somebody (private mail is okay) please clarify this for me? It looks me
>> like there's a proposal to introduce `@@` syntax to support something that's
>> forbidden in most es6 code anyways (`with`)? Or does it have other use
>> cases? Where can I read more about this?
>
> It's a proposed backwards compatibility thing to work around the
> problem that uses of 'with' in the wild are not robust against
> extensions of standard objects, see Section 4.3 of the July 23 meeting
> notes:
>
> https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-07/july-23.md
>
> Unfortunately, many people still use 'with', and we can't break the web.
>
> (The @@-syntax is just a placeholder we got into the habit of using to
> denote predefined symbols.)
>
> /Andreas
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



-- 
erik


More information about the es-discuss mailing list