On Sat, Sep 28, 2013 at 2:49 PM, Axel Rauschmayer <[email protected]> wrote:
> Has this feature ever been considered?
>
> For example:
>
> ```
> $ var env = { __proto__: window, foo: 1 };
> $ eval('var bar = foo+1', env);
> $ env.bar
> 2
> ```
>
See the "confine" function at <
https://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/ses/startSES.js#855>,
also documented in section 2.3 of <
http://research.google.com/pubs/pub40673.html>.
>
> Useful for writing interpreters and more convenient for interacting with
> evaluated code than improvising something equivalent via `Function`.
>
> Axel
>
> --
> Dr. Axel Rauschmayer
> [email protected]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
--
Cheers,
--MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss