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 syntax error for comments in array #607

Merged
merged 2 commits into from
Oct 10, 2019
Merged

Fix syntax error for comments in array #607

merged 2 commits into from
Oct 10, 2019

Conversation

PalAditya
Copy link
Contributor

Fixes #602

The error came from the fact that token type comment was not expected within array literal, so added that case to handle that error. Also added multiple test cases in testsrc/org/mozilla/javascript/tests/ParserTest.java under the function testCommentInArray() to check all possible cases (single/multiple/no comments, and comments between literals)

Please mention if something else needs to be fixed for this PR 😄

@PalAditya
Copy link
Contributor Author

Capture
Just adding the local Jacoco coverage for easy reference :)

Copy link
Collaborator

@gbrail gbrail left a comment

Choose a reason for hiding this comment

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

Great -- a test case that broke before and a change that fixes it. Works for me!

If you have time, I'd prefer that you change the formatting of the changes to match the lines around them, however.

src/org/mozilla/javascript/Parser.java Outdated Show resolved Hide resolved
src/org/mozilla/javascript/Parser.java Outdated Show resolved Hide resolved
@gbrail
Copy link
Collaborator

gbrail commented Oct 10, 2019

Thanks! I'm going to squash these two commits into one and merge them.

@gbrail gbrail merged commit e85ebaf into mozilla:master Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syntax error with comments in array declaration
2 participants