diff --git a/jerry-core/parser/js/parser.cpp b/jerry-core/parser/js/parser.cpp index c445d7d87..24012e3b9 100644 --- a/jerry-core/parser/js/parser.cpp +++ b/jerry-core/parser/js/parser.cpp @@ -1756,6 +1756,8 @@ parse_expression (bool in_allowed, /**< flag indicating if 'in' is allowed insid skip_newlines (); if (token_is (TOK_COMMA)) { + dump_assignment_of_lhs_if_literal (expr); + skip_newlines (); expr = parse_assignment_expression (in_allowed); } @@ -2828,7 +2830,8 @@ parse_statement (jsp_label_t *outermost_stmt_label_p) /**< outermost (first) lab { lexer_save_token (tok); tok = temp; - parse_expression (true, JSP_EVAL_RET_STORE_DUMP); + operand expr = parse_expression (true, JSP_EVAL_RET_STORE_DUMP); + dump_assignment_of_lhs_if_literal (expr); skip_newlines (); if (!token_is (TOK_SEMICOLON)) { diff --git a/tests/unit/test-api.cpp b/tests/unit/test-api.cpp index 37c6c414a..0b1c85814 100644 --- a/tests/unit/test-api.cpp +++ b/tests/unit/test-api.cpp @@ -41,7 +41,7 @@ const char *test_source = ( " return this.external ('1', true); " "} " "function call_throw_test() { " - " bool catched = false " + " var catched = false " " try { " " this.throw_test(); " " } catch (e) { "