Skip to content

Conversation

@rerobika
Copy link
Member

@rerobika rerobika commented Jan 2, 2019

This patch fixes #2656 and fixes #2659 as well.

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

@rerobika rerobika changed the title Fix "arguments" string parsing inside functions Fix "argument" string parsing inside functions Jan 2, 2019
@rerobika rerobika changed the title Fix "argument" string parsing inside functions Fix "arguments" string parsing inside functions Jan 2, 2019
@zherczeg
Copy link
Member

zherczeg commented Jan 2, 2019

Uh bad news. This is a side effect of my other patch which added types for strings. What other effects can it cause. I will be back next week, lets discuss this first please.

@rerobika rerobika changed the title Fix "arguments" string parsing inside functions Fix "arguments" and "eval" parsing Jan 2, 2019
@rerobika
Copy link
Member Author

rerobika commented Jan 2, 2019

I've investigated a bit more and you were right, the issues are due to #2634. I think I found an universal solution for it, but it's definitely worth a discussion.

context_p->status_flags |= PARSER_ARGUMENTS_NEEDED | PARSER_LEXICAL_ENV_NEEDED;
context_p->lit_object.literal_p->status_flags |= LEXER_FLAG_NO_REG_STORE;
context_p->lit_object.type = LEXER_LITERAL_OBJECT_ARGUMENTS;
if (!(context_p->status_flags & PARSER_ARGUMENTS_NOT_NEEDED))
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps an ident check could work here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, it worked!

This patch fixes jerryscript-project#2656 and fixes jerryscript-project#2659 as well.

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

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

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

Please also fix #2699 in this PR.

@rerobika
Copy link
Member Author

@LaszloLango I've checked whether this PR solves #2699 but unfortunately it isn't since they are not related to each other (only the arguments keyword have in common). Also it's a bit harder nut to crack so I'd try to fix it in an other PR.

@LaszloLango
Copy link
Contributor

@rerobika, it is OK to do it in a new PR if they are not related.

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

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

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

LGTM

@LaszloLango LaszloLango merged commit c305d70 into jerryscript-project:master Jan 15, 2019
@rerobika rerobika deleted the fix_issue_2656 branch February 28, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants