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

