-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
repl hates comments with quotes in indented code #3421
Comments
I played around with this code today and found there are two other scenarios where we can get this same error.
The other scenario:
|
After reviewing the repl code, I think I have a fix. I've included repl's parseLine function with my annotated changes below. Is this ready for a pull request @thefourtheye ?
|
@ChuckLangford I think it's going to be more complicated than that? For example, this fails also, but with a different exception:
|
@ChuckLangford Yes, what @mscdex said is true. I am working on a fix with a little of bit of refactoring as well. I think I'll send a PR today or tomorrow. |
Awesome. Thanks for the feedback. As a coding exercise, I'm going to continue working on this problem. @mscdex @thefourtheye have either of you found any other examples of comment related code that will crash repl? |
@ChuckLangford I haven't had time to do any exhaustive testing yet, so it's possible there may be some other cases lurking... |
PTAL at the proposed fix #3515 |
As it is, the comments are not handled properly in REPL. So, if the comments have `'` or `"`, then they are treated as string literals and the error is thrown in REPL. This patch refactors the existing logic and groups everything in a class. Fixes: nodejs#3421
As it is, the comments are not handled properly in REPL. So, if the comments have `'` or `"`, then they are treated as incomplete string literals and the error is thrown in REPL. This patch refactors the existing logic and groups everything in a class. Fixes: #3421 PR-URL: #3515 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
As it is, the comments are not handled properly in REPL. So, if the comments have `'` or `"`, then they are treated as incomplete string literals and the error is thrown in REPL. This patch refactors the existing logic and groups everything in a class. Fixes: nodejs#3421 PR-URL: nodejs#3515 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
As it is, the comments are not handled properly in REPL. So, if the comments have `'` or `"`, then they are treated as incomplete string literals and the error is thrown in REPL. This patch refactors the existing logic and groups everything in a class. Fixes: #3421 PR-URL: #3515 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Same happens with
//"
The text was updated successfully, but these errors were encountered: