Fix insert_semicolon

This commit is contained in:
Ilmir Usmanov
2014-10-08 19:15:25 +04:00
parent 24920cba57
commit 1dd94c12b2
3 changed files with 21 additions and 12 deletions
+3 -2
View File
@@ -1132,7 +1132,7 @@ parse_function_expression (void)
parse_source_element_list (false);
pop_nesting (NESTING_FUNCTION);
token_after_newlines_must_be (TOK_CLOSE_BRACE);
next_token_must_be (TOK_CLOSE_BRACE);
DUMP_VOID_OPCODE (ret);
rewrite_meta_opcode_counter (STACK_TOP (U16), OPCODE_META_TYPE_FUNCTION_END);
@@ -3001,8 +3001,9 @@ insert_semicolon (void)
{
// We cannot use TOK (), since we may use lexer_save_token
skip_token ();
if (lexer_prev_token ().type == TOK_NEWLINE)
if (token_is (TOK_NEWLINE) || lexer_prev_token ().type == TOK_NEWLINE)
{
lexer_save_token (TOK ());
return;
}
if (!token_is (TOK_SEMICOLON))