I didn't know that SpiderMonkey did that, but I agree it is better. In
light of this news, I'm glad my code sample doesn't work ;).

As for "would be good for all engines to act the same", the
precondition was carefully crafted so that engines did not need to
retain the original source, but rather, just enough for behavioral
equivalence. Nevertheless, if we could get everyone to agree on
SpiderMonkey's behavior here, it would be better. Too late for ES6
though.



On Thu, Dec 18, 2014 at 9:09 AM, Till Schneidereit
<[email protected]> wrote:
>
>
> On Thu, Dec 18, 2014 at 6:01 PM, Mark S. Miller <[email protected]> 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.
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
Text by me above is hereby placed in the public domain

  Cheers,
  --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to