Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assignment lookahead in parser_process_group_expression #3828

Merged
merged 1 commit into from Jun 3, 2020

Conversation

rerobika
Copy link
Member

@rerobika rerobika commented Jun 2, 2020

This patch fixes #3815.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu

if (context_p->token.type == LEXER_ASSIGN)
#if ENABLED (JERRY_ES2015)
if (context_p->token.type == LEXER_ASSIGN
&& parser_is_assignment_expr (context_p))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about limiting this to identifiers?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

parser_append_binary_single_assignment_token (context_p, flags);
lexer_next_token (context_p);
return true;
/* Lookahead for anonymous function declatartion after '=' token when the assignment base is LHS expression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declatartion -> declaration

This patch fixes jerryscript-project#3815 and fixes jerryscript-project#3819.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Copy link
Member

@dbatyai dbatyai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbatyai dbatyai merged commit fe09200 into jerryscript-project:master Jun 3, 2020
@rerobika rerobika deleted the fix_issue_3815 branch June 16, 2020 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment