Fix the parsing/scanning of empty return statement (#3468)
This patch fixes #3467. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Zoltan Herczeg
parent
9596a7e1d6
commit
ea5ad2a06f
@@ -2914,6 +2914,7 @@ parser_parse_statements (parser_context_t *context_p) /**< context */
|
||||
|
||||
if ((context_p->token.flags & LEXER_WAS_NEWLINE)
|
||||
|| context_p->token.type == LEXER_SEMICOLON
|
||||
|| context_p->token.type == LEXER_EOS
|
||||
|| context_p->token.type == LEXER_RIGHT_BRACE)
|
||||
{
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
|
||||
@@ -1591,6 +1591,7 @@ scanner_scan_statement (parser_context_t *context_p, /**< context */
|
||||
|
||||
if (!(context_p->token.flags & LEXER_WAS_NEWLINE)
|
||||
&& context_p->token.type != LEXER_SEMICOLON
|
||||
&& context_p->token.type != LEXER_EOS
|
||||
&& context_p->token.type != LEXER_RIGHT_BRACE)
|
||||
{
|
||||
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
|
||||
Reference in New Issue
Block a user