Skip to content

Commit

Permalink
Add syntax error on newline after 'throw'
Browse files Browse the repository at this point in the history
  • Loading branch information
polazarus authored and mishoo committed Sep 17, 2011
1 parent ff46b80 commit 1b94161
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/parse-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,8 @@ function parse($TEXT, exigent_mode, embed_tokens) {
return as("switch", parenthesised(), switch_block_());

case "throw":
if (S.token.nlb)
croak("Illegal newline after 'throw'");
return as("throw", prog1(expression, semicolon));

case "try":
Expand Down

0 comments on commit 1b94161

Please sign in to comment.