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

Brendan Eich brendan at mozilla.org
Thu Dec 18 15:27:22 PST 2014


Till Schneidereit wrote:
> On Thu, Dec 18, 2014 at 6:15 PM, Mark Miller <erights at gmail.com 
> <mailto: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.

File a bug at https://bugs.ecmascript.org/ and let's see where that goes!

/be


More information about the es-discuss mailing list