On 4/19/11, Brendan Eich <bren...@mozilla.com> wrote: > On Apr 19, 2011, at 3:08 PM, Garrett Smith wrote: > >> On 4/19/11, Isaac Schlueter <i...@izs.me> wrote: >>> ASI didn't change the program behavior. ASI didn't happen in that >>> example. > > Isaac is correct. > > >>> Newline elision changed the program behavior. > > Or newlines being insignificant whitespace, let's say. > I don't see how whitespace is relevant here. > >> No, `MyWidget = function(){}` was not explicitly terminated by a >> semicolon. The end of the input stream is reached and a semicolon is >> inserted. > > Not in the concatenation of a.js and b.js. Please attend to your own > example. > No, when a.js exists on its own, a semicolon is inserted. When concatenated with b.js that doesn't happen.
> Only if a.js is processed as a Program (the grammar's goal nonterminal), in > which case, yes, ASI kicks in, and no, there is no subsequent ( or [ or > similar input to cause trouble. > That's what I'm talking about. > >> "Newline elision" did not change behavior. >> >> Concatenation of a.js and b.js results in behavior that is not the >> same as when a.js and b.js are in separate files. > > That is true, but now you are changing the terms of the debate. The claim > that ASI does not affect non-error semantics applies for any given Program > -- not for Program X and Program Y. > Is it "program" or "Program" we're discussing? What'd I write? If I wrote "Program" I take it back. But if I wrote "program" then I got what I meant write (and pedantic misquoting is a waste of time). > What you describe is a hazard, we've covered it. But your argument foundered > on ASI applying differently on two different programs. Of course that can > happen. > If ASI is warned by the interpreted, then the developer of a.js will know before running through compression tools. If that ASI were to be an error, then it would be fail fast. Call me a hater if it makes you feel better, but I find fail fast to be a lot better. -- Garrett _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss