-
Notifications
You must be signed in to change notification settings - Fork 65
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
JS Lexer exit with error on \uFFFD #118
Comments
Hi Kobi, that is because the \uFFFD character cannot be the start of an identifier (or its continuation), which would be the only possibility to have that character present (except from having that character in string or template literals). So unfortunately, the lexer is right to throw an error in this case. What use-case do you have? Could you simply ignore this error? |
This came from a customer that in one of his files he have this character... |
Unfortunately, the client's file is invalid JS and will throw an error with any spec compliant parser. I've changed the lexer to clear the error if you decide to continue lexing after an error occurred. that should help you out. |
Thank you. |
@tdewolff , |
How can I know how much to skip? coz when I try I use the Next() it keep trying to tokenize the same character over and over. |
Should be working now in v2.7.14! Please let me know how it goes. |
Parsing JS with some script that in some point we have \uFFFD.
The "Next()" function return with the next error:
unexpected � on line 135 and column 5
135: �});
^
Any idea how to handle it better?
This came up after upgrading from 2.4.4 to 2.7.13.
Thanks
The text was updated successfully, but these errors were encountered: