Till Schneidereit (2014-12-18T17:26:45.000Z)
On Thu, Dec 18, 2014 at 6:15 PM, Mark Miller <erights at gmail.com> wrote:
>
> 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.
>

SpiderMonkey does retain the original source. However, it adds the "use
strict" if the function is defined in a strict-mode scope. Reading the
rules for Function.prototype.toString, it's clear that not doing that is
valid, as the spec only requires behavioral equivalence "if the string is
evaluated, using eval in a lexical context that is equivalent to the
lexical context".

So yes, it would be nice to get agreement here, but it's not as important
as I first thought.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141218/a633906e/attachment.html>
d at domenic.me (2015-01-05T20:39:58.827Z)
SpiderMonkey does retain the original source. However, it adds the "use
strict" if the function is defined in a strict-mode scope. Reading the
rules for Function.prototype.toString, it's clear that not doing that is
valid, as the spec only requires behavioral equivalence "if the string is
evaluated, using eval in a lexical context that is equivalent to the
lexical context".

So yes, it would be nice to get agreement here, but it's not as important
as I first thought.