-
Notifications
You must be signed in to change notification settings - Fork 683
Fix RegExp literal parsing #554
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 RegExp literal parsing #554
Conversation
|| prev_non_lf_token.type == TOK_SMALL_INT | ||
|| prev_non_lf_token.type == TOK_NUMBER | ||
|| prev_non_lf_token.type == TOK_STRING | ||
|| prev_non_lf_token.type == TOK_REGEXP)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOK_CLOSE_PAREN
and TOK_CLOSE_BRACE
could precede regular expression, for example:
if (true) /abc/.exec("abc");
if (true) {} /abc/.exec("abc");
This case is harder to support, possibly, we could implement it in another patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another case:
var a
/abc/.exec("abc");
Could you, please, create an issue for the mentioned tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue can be found here: #563
c3acb74
to
6fc3e43
Compare
@sand1k, I've updated the patch, it should work correctly now. Please check. |
LGTM. |
LGTM |
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
6fc3e43
to
4ee30cb
Compare
No description provided.