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

Tolerate unclosed block comment #1041

Closed
ariya opened this Issue Feb 16, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@ariya
Contributor

ariya commented Feb 16, 2015

Consider the following test code (parsing in tolerant mode):

require('./esprima').parse('x /* foobar', { tolerant: true })

The current master branch will thrown an exception due to the error Line 1: Unexpected token ILLEGAL.

If this feature is implemented, it will return an AST because the unclosed block comment is tolerated. The error will be still listed in the errors array.

(Migrated from https://code.google.com/p/esprima/issues/detail?id=582, as reported by @mrennie)

@ariya ariya added the enhancement label Feb 16, 2015

@ariya ariya closed this in 437036e Feb 20, 2015

@ariya ariya added this to the 2.1 milestone Feb 20, 2015

ariya added a commit to ariya/esprima that referenced this issue Mar 13, 2015

Simplify the logic to handle unclosed block comment.
There is no need to check for EOF here because it is implied when
the previous while loop terminates.

Refs #1041

ariya added a commit that referenced this issue Mar 13, 2015

Simplify the logic to handle unclosed block comment.
There is no need to check for EOF here because it is implied when
the previous while loop terminates.

Refs #1041
Closes gh-1115
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment