Fix the initialization of let/const patterns when block context is needed. (#3320)
Also some code cuplication is removed. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
committed by
Dániel Bátyai
parent
8eda9bc1c3
commit
fca0c94002
@@ -451,7 +451,13 @@ parser_parse_var_statement (parser_context_t *context_p) /**< context */
|
||||
|| lexer_check_next_character (context_p, LIT_CHAR_LEFT_SQUARE))
|
||||
{
|
||||
lexer_next_token (context_p);
|
||||
parser_parse_initializer (context_p, PARSER_PATTERN_BINDING);
|
||||
parser_pattern_flags_t options = PARSER_PATTERN_BINDING;
|
||||
|
||||
if (declaration_type != LEXER_KEYW_VAR)
|
||||
{
|
||||
options |= PARSER_PATTERN_LEXICAL;
|
||||
}
|
||||
parser_parse_initializer (context_p, options);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user