This is explained in the spec:
7.3 Line Terminators
Like white space characters, line terminator characters are used to
  improve source text readability and to separate tokens (indivisible
  lexical units) from each other. However, unlike white space
  characters, line terminators have some influence over the behaviour of
  the syntactic grammar. In general, line terminators may occur between
  any two tokens, but there are a few places where they are forbidden by
  the syntactic grammar. Line terminators also affect the process of
  automatic semicolon insertion (7.9).
7.9 Automatic Semicolon Insertion
Certain ECMAScript statements (empty statement, variable statement,
  expression statement, do-while statement, continue statement,
  break statement, return statement, and throw statement) must be
  terminated with semicolons. Such semicolons may always appear
  explicitly in the source text. For convenience, however, such
  semicolons may be omitted from the source text in certain situations.
  These situations are described by saying that semicolons are
  automatically inserted into the source code token stream in those
  situations.
So in most cases you can do it. And your case is one of these.