On Apr 19, 2011, at 3:54 PM, Garrett Smith wrote:
> On 4/19/11, Brendan Eich <[email protected]> wrote:
>> On Apr 19, 2011, at 3:08 PM, Garrett Smith wrote:
>>
>>> On 4/19/11, Isaac Schlueter <[email protected]> wrote:
>>>> Newline elision changed the program behavior.
>>
>> Or newlines being insignificant whitespace, let's say.
>>
> I don't see how whitespace is relevant here.
The newline creates an expectation of statement termination in many readers.
That's all.
>>> 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.
I said that!
Look, I just wrote "Not in the concatenation of a.js and b.js." You then tried
to rebut by talking about a.js in isolation.
Let's get off this merry-go-round. We seem to agree, but you are not arguing
that semantics of a given program can change due to ASI. Concatenation makes a
new program. Yes, this is commonly done and therefore ASI going away due to
concatenation is a hazard.
> If ASI is warned by the interpreter, 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.
No, Ollie is the hater ;-).
You are asking for an warning when a file ends without a semicolon required by
the grammar, and ASI kicks in. Fair point, good idea. It's not going to do
enough by itself, since warnings are easy to miss, and often annoy the wrong
party (the user of content, where the dev is long gone).
But good point. Indeed, feel free to file a bug at https://bugzilla.mozilla.org
asking for such a warning. I'll support it.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss