What's being done with the values of 1, 2, undefined, true/false, 3 and undefined? Nothing if they're not assigned. But as every function returns a value and invocations are therefore an expression, it would be impossible to disallow expressions to be evaluated but not assigned.
It tries to parse a newline with no semicolon as continuing the current expression, if it can't, it inserts a semicolon.
It's a 'feature' that's caused too many bugs and is a warning in most linters.