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
@@ -432,6 +432,13 @@ scanner_scan_primary_expression (parser_context_t *context_p, /**< context */
|
||||
scanner_raise_error (context_p);
|
||||
}
|
||||
scanner_context_p->mode = SCAN_MODE_PRIMARY_EXPRESSION;
|
||||
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
if (scanner_context_p->binding_type != SCANNER_BINDING_NONE)
|
||||
{
|
||||
scanner_context_p->mode = SCAN_MODE_BINDING;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
break;
|
||||
}
|
||||
case LEXER_RIGHT_PAREN:
|
||||
|
||||
Reference in New Issue
Block a user