What would a 1JS-friendly strict mode look like?

Till Schneidereit till at tillschneidereit.net
Thu Dec 18 09:09:57 PST 2014

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>

More information about the es-discuss mailing list