OK, so a semicolon is automatically inserted if:
1. The code cannot be parsed without a semicolon and
- there's a line break,
- the last token is a `}`, or
- the last token is the last `)` of a do-while statement.
2. The end of the source code is reached and the code can't be parsed without a semicolon at the end.
3. The code can be parsed with or without the semicolon, and the expression is not
- ++ or --;
- continue, break, return, throw, or yield;
- the arguments of an arrow function.