by ahoyhere · 14y ago · 0 comments
No, actually, that's how it works in JS. ASI doesn't "work" in all cases because a line break doesn't always indicate the end of a statement. No less than Brendan Eich wrote this himself, in his blog post reply to the whole "semicolongate" which happened a couple weeks ago.
I'm sure it feels good to be all righteously angry… but it helps to be right.
> My two cents: be careful not to use ASI as if it gave JS significant newlines.
> Weasel word: An equivocal word used to deprive a statement of its force or to evade a direct commitment.
From the article, emphasis mine:
> A linebreak indicates, in most cases, the end of a statement;