Make object short notation work if there's a linefeed before end

Fixes #1923
Closes #1924
Fix ASI rules for directives. Fixes gh-1906