-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: refine handling of illegal tokens #7104
Conversation
Before:
After:
|
But this still works, as expected: Before:
After:
(No change between the two.) |
LGTM although checking for ILLEGAL could break when we upgrade V8. |
@bnoordhuis Seems fine, the test will catch it. |
@@ -1154,6 +1154,9 @@ REPLServer.prototype.convertToContext = function(cmd) { | |||
return cmd; | |||
}; | |||
|
|||
function bailOnIllegalToken(lp) { | |||
return lp._literal === null && !lp.blockComment && !lp.regExpLiteral; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parser
rather than lp
?
Is it possible to generate EDIT: Yes, it is very very possible. |
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
Nits addressed, re-running CI: https://ci.nodejs.org/job/node-test-pull-request/2919/ |
Only CI failure was a single build failure on a Raspberry Pi. Trying again because YOU CAN'T BE TOO CAREFUL!!!11!!! or something like that. |
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: nodejs#7104 Fixes: nodejs#3611 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed in de0aa23 |
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>
@Trott lts? |
@thealphanerd If it lands cleanly, yes. |
this one does not land cleanly |
Checklist
Affected core subsystem(s)
Description of change
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: #3611