d at domenic.me (2015-01-05T20:39:49.652Z)
On Thu, Dec 18, 2014 at 6:01 PM, Mark S. Miller <erights at google.com> wrote:
> ```js
> (1,eval)("" + function(){...strict code you want to execute sloppy...})()
> ```
This doesn't work in SpiderMonkey: stringifying functions retains their
strictness, no matter where strict mode is activated. In this case, the
result would be the string `function (){\n"use strict";\n...strict code you want to execute sloppy...}`
It's unfortunate that this doesn't behave the same in all engines, but I
would argue that SpiderMonkey's stringification is the more faithful one.
On Thu, Dec 18, 2014 at 6:01 PM, Mark S. Miller <erights at google.com> wrote: > > (1,eval)("" + function(){...strict code you want to execute sloppy...})() > This doesn't work in SpiderMonkey: stringifying functions retains their strictness, no matter where strict mode is activated. In this case, the result would be the string 'function (){\n"use strict";\n...strict code you want to execute sloppy...}' It's unfortunate that this doesn't behave the same in all engines, but I would argue that SpiderMonkey's stringification is the more faithful one. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141218/bf768fd8/attachment.html>