Mark S. Miller (2014-12-18T17:01:25.000Z)
d at domenic.me (2015-01-05T20:39:32.181Z)
On Thu, Dec 18, 2014 at 8:50 AM, Caitlin Potter <caitpotter88 at gmail.com> wrote: > eval has other implications, so it doesn’t always accomplish what you want > :( It's good enough for these tests. > Plus, the contents are a lot harder to read in most text editors ;) ```js (1,eval)("" + function(){...strict code you want to execute sloppy...})() ``` The code in the function is actually strict code, and your editor will treat it as such. However, Function.prototype.toString.call(user-written-function) will result in function source that, when evaled in a sufficiently similar lexical context, will yield a function with the same [[Call]] behavior. In this case, we're violating the spec precondition by evaling it in a context that's sloppy rather than strict. Practically, this does what you want. > Well sure, but unfortunately it’s not going to just disappear :( See how much good deprecating it did?