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:
Robert Fancsik
2019-11-15 14:38:14 +01:00
committed by Dániel Bátyai
parent 8eda9bc1c3
commit fca0c94002
8 changed files with 297 additions and 205 deletions
+7
View File
@@ -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: