diff options
Diffstat (limited to 'jerry-core/parser/js/js-parser-expr.c')
-rw-r--r-- | jerry-core/parser/js/js-parser-expr.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/jerry-core/parser/js/js-parser-expr.c b/jerry-core/parser/js/js-parser-expr.c index 3e8af5ba..43c28014 100644 --- a/jerry-core/parser/js/js-parser-expr.c +++ b/jerry-core/parser/js/js-parser-expr.c @@ -430,7 +430,15 @@ parser_parse_object_literal (parser_context_t *context_p) /**< context */ lexer_next_token (context_p); parser_parse_expression (context_p, PARSE_EXPR_NO_COMMA); - parser_emit_cbc_literal (context_p, CBC_SET_PROPERTY, literal_index); + if (context_p->last_cbc_opcode == CBC_PUSH_LITERAL) + { + context_p->last_cbc_opcode = CBC_SET_LITERAL_PROPERTY; + context_p->last_cbc.value = literal_index; + } + else + { + parser_emit_cbc_literal (context_p, CBC_SET_PROPERTY, literal_index); + } } if (context_p->token.type == LEXER_RIGHT_BRACE) |