Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are a few minor, uncommon edge cases, probably only encountered by minimisers, where automatic semicolon insertion may cause unintentional behaviour, so semicolons are required. One of the specs; https://262.ecma-international.org/7.0/#sec-rules-of-automat... (link from an earlier comment of like) spells it out in detail.


While these edge cases are fairly rare in everyday JS codebases, Typescript adds some, e.g. inline type casts for function calls:

    const foo = someFn()
    (foo as Bar).doSomething()




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: