-
Notifications
You must be signed in to change notification settings - Fork 30k
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 should raise Exception immediately when it gets naturally invalid multi-line. #3611
Comments
confirmed the bug is present in all versions |
This particular case is not trivial to fix. |
I think it should be fixable, we should just do extra checks for Fwiw, you can also break out by:
|
Good news.
I think so. I tried it actually.
I hope this solution if we have no valid two enters.
Ah, that’s true. And I noticed typing backslash will trigger a syntax error also. |
Proposed fix: #7104 |
Illegal tokens are only recoverable in string literals, RegExp literals, and block comments. If not in one of these constructs, immediately return an error rather than giving the user false hope by giving them a chance to try to recover. Fixes: nodejs#3611
#7104 landed so this should be fixed in the next 6.x release (which will be either 6.2.2 or 6.3.0). |
Illegal tokens are only recoverable in string literals, RegExp literals, and block comments. If not in one of these constructs, immediately return an error rather than giving the user false hope by giving them a chance to try to recover. PR-URL: #7104 Fixes: #3611 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
I'm using v5.0.0 on Windows.
Of course this is invalid as javascript:
But REPL enters multi-line editting mode:
We have no way to exit from the mode except
.break
(or Ctrl-C), and.break
will make nothing.The text was updated successfully, but these errors were encountered: