Axel Rauschmayer <mailto:[email protected]>
September 28, 2013 2:49 PM
Has this feature ever been considered?
Lots of times, going back at least as far as
http://wiki.ecmascript.org/doku.php?id=discussion:resurrected_eval
Read under "Resolved issues".
SpiderMonkey had a two-argument eval for ages, from before the modern
era. We removed it. No one should be messing with the signature of eval
at this point.
Module loader API supersedes all such ideas in ES6.
/be
For example:
```
$ var env = { __proto__: window, foo: 1 };
$ eval('var bar = foo+1', env);
$ env.bar
2
```
Useful for writing interpreters and more convenient for interacting
with evaluated code than improvising something equivalent via `Function`.
Axel
--
Dr. Axel Rauschmayer
[email protected] <mailto:[email protected]>
home: rauschma.de <http://rauschma.de>
twitter: twitter.com/rauschma <http://twitter.com/rauschma>
blog: 2ality.com <http://2ality.com>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss