> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Steven Mascaro > Sent: 16. mai 2008 22:34 > To: [email protected] > Subject: Forwards-compatible syntax proposal > > Ian Hickson wrote: > >> Another reaction is that there are ES4 source fragments > that /can/ be > >> parsed by ES3 compilers, but whose meaning will silently > be something > >> completely different in the two versions of the language. > Here are > >> some: > >> > >> // a generator expression in ES4, a loop calling a function > >> // in ES3 > >> > >> function f(x) { > >> for ( i=0 ; i < 10 ; i++ ) > >> yield (f(), i) > >> } > >> > >> // (artificial) three statements in ES3, two in ES4 > >> > >> x = this function > >> f(x) > >> { x++ } > > > > I think this is very dangerous, and unwise, in the context of the Web. > > I strongly believe that if we want to have success in expanding the > > Web platform, backwards-compatibility is critical. But that's another issue. > > I agree. Lars, surely this is unacceptable by your very own reasoning > --- because there will be ES3 code that will run in ES4, but > with silently different behaviour.
I don't know what hixie is getting at exactly (whether he's referring to the first or the second example). I've spent some time examining compatibility between ES3 and ES4 [1]. Opt-in to ES4 keeps you out of most trouble. --lars [1] http://www.ecmascript.org/es4/spec/incompatibilities.pdf _______________________________________________ Es4-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es4-discuss
