-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Make REPL support multiline template literals #333
Conversation
ziyunfei
commented
Jan 13, 2015
Your PR looks reasonable to me but can you:
Thanks! |
@ziyunfei Ping. |
/^(Unexpected end of input|Unexpected token :)/.test(e.message); | ||
function isRecoverableError(e, self) { | ||
if (e && e.name === 'SyntaxError') { | ||
if (e.message == 'Unterminated template literal') { |
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.
there are actually a few different messages you could get, unterminated_template
and unterminated_template_expr
in particular would affect this (https://github.com/v8/v8-git-mirror/blob/master/src/messages.js#L25-L26)
Let REPL enter multiline mode if user's input contains unterminated template literals.
@bnoordhuis Pong, sorry for the long delay. |
Let REPL enter multiline mode if user's input contains unterminated template literals. PR-URL: #333 Reviewed-By: Ben Noordhuis <[email protected]>
Thanks @ziyunfei, landed in b7365c1. Nice addition! |
beware of the segfault bug in template strings atm :( just fixed this morning |
@caitp Is that https://codereview.chromium.org/857433004? I saw that, hadn't realized it fixes a segfault. Is it going to get back-ported to 4.1? |
I hope so, it would not be a very good user experience to crash chrome on people! |