Improve expected identifier checks. (#3064)
Checks for "of" or "from" does not accept quoted strings. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Robert Fancsik
parent
086c4ebf13
commit
96edec1a62
@@ -720,7 +720,7 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
context_p->token.type = LEXER_KEYW_IN;
|
||||
return;
|
||||
}
|
||||
else if (type == LEXER_LITERAL && lexer_compare_raw_identifier_to_current (context_p, "of", 2))
|
||||
else if (lexer_compare_literal_to_identifier (context_p, "of", 2))
|
||||
{
|
||||
parser_stack_pop_uint8 (context_p);
|
||||
context_p->token.type = LEXER_LITERAL_OF;
|
||||
@@ -788,13 +788,13 @@ parser_scan_until (parser_context_t *context_p, /**< context */
|
||||
break;
|
||||
}
|
||||
|
||||
if (lexer_compare_raw_identifier_to_current (context_p, "static", 6))
|
||||
if (lexer_compare_literal_to_identifier (context_p, "static", 6))
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
}
|
||||
|
||||
if (lexer_compare_raw_identifier_to_current (context_p, "get", 3)
|
||||
|| lexer_compare_raw_identifier_to_current (context_p, "set", 3))
|
||||
if (lexer_compare_literal_to_identifier (context_p, "get", 3)
|
||||
|| lexer_compare_literal_to_identifier (context_p, "set", 3))
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user