Fix ReferenceError for let/const variables in of/in for loop (#3885)
ReferenceError should be thrown when variable is used before assignment JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
This commit is contained in:
@@ -2108,7 +2108,7 @@ scanner_scan_statement_end (parser_context_t *context_p, /**< context */
|
||||
while ((literal_p = (lexer_lit_location_t *) parser_list_iterator_next (&literal_iterator)) != NULL)
|
||||
{
|
||||
if ((literal_p->type & (SCANNER_LITERAL_IS_LET | SCANNER_LITERAL_IS_CONST))
|
||||
&& literal_p->type & SCANNER_LITERAL_NO_REG)
|
||||
&& (literal_p->type & SCANNER_LITERAL_IS_USED))
|
||||
{
|
||||
literal_p->type |= SCANNER_LITERAL_EARLY_CREATE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user