Skip to content

Commit 7a47ad3

Browse files
author
Ruben Ayrapetyan
committed
Set is_need_retval flag to false for expressions in initialization and increment parts of for loop, in variable declarations statement.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
1 parent b656ec1 commit 7a47ad3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jerry-core/parser/js/parser.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3772,6 +3772,8 @@ jsp_parse_source_element_list (jsp_parse_mode_t parse_mode)
37723772
if (!token_is (TOK_SEMICOLON))
37733773
{
37743774
jsp_push_new_expr_state (JSP_STATE_EXPR_EMPTY, JSP_STATE_EXPR_EXPRESSION, false);
3775+
3776+
jsp_state_top ()->is_need_retval = false;
37753777
}
37763778
else
37773779
{
@@ -4093,6 +4095,8 @@ jsp_parse_source_element_list (jsp_parse_mode_t parse_mode)
40934095
seek_token (name_loc);
40944096

40954097
jsp_push_new_expr_state (JSP_STATE_EXPR_EMPTY, JSP_STATE_EXPR_ASSIGNMENT, true);
4098+
4099+
jsp_state_top ()->is_need_retval = false;
40964100
}
40974101

40984102
state_p->state = JSP_STATE_STAT_VAR_DECL_FINISH;
@@ -4238,6 +4242,8 @@ jsp_parse_source_element_list (jsp_parse_mode_t parse_mode)
42384242
if (!token_is (TOK_CLOSE_PAREN))
42394243
{
42404244
jsp_push_new_expr_state (JSP_STATE_EXPR_EMPTY, JSP_STATE_EXPR_EXPRESSION, true);
4245+
4246+
jsp_state_top ()->is_need_retval = false;
42414247
}
42424248
else
42434249
{

0 commit comments

Comments
 (0)