You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repl: backslashes confuse the multiline parser #2749
> function x() {
... return '\n';
SyntaxError: Unexpected end of input
at Object.exports.createScript (vm.js:24:10)
at REPLServer.defaultEval (repl.js:137:25)
at bound (domain.js:250:14)
at REPLServer.runBound [as eval] (domain.js:263:12)
at REPLServer.<anonymous> (repl.js:392:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:546:8)
at REPLServer.Interface._ttyWrite (readline.js:823:14)
Mmmm, this is because the readline module parsing \ns as separate lines while parsing the pasted content. I'll look into it today. Glad you spotted it :-)
@silverwind It's after this 81ea52a. Before that the string was accumulated no matter what, till the evaluation of accumulated string is successful. But that commit keeps track of the quotes to detect the string literals.
Activity
thefourtheye commentedon Sep 9, 2015
Mmmm, this is because the readline module parsing
\ns as separate lines while parsing the pasted content. I'll look into it today. Glad you spotted it :-)silverwind commentedon Sep 9, 2015
It's not just
\ns, I actually encountered it with a\(first.silverwind commentedon Sep 9, 2015
Looks to be a pretty recent regression, 0.12 works.
thefourtheye commentedon Sep 9, 2015
@silverwind It's after this 81ea52a. Before that the string was accumulated no matter what, till the evaluation of accumulated string is successful. But that commit keeps track of the quotes to detect the string literals.
valenfys commentedon Sep 16, 2015
Can confirm I got this problem too when trying the hello world server from the website about page in the REPL.
thefourtheye commentedon Sep 16, 2015
@silverwind I think we'll have to revert 81ea52a to fix this problem. cc @Fishrock123
silverwind commentedon Sep 18, 2015
👍 for the revert. Being unable to paste any multi-line code containing backslashes warrents it imho.
silverwind commentedon Sep 18, 2015
@thefourtheye want to attempt the revert yourself? (We could probably use some documentation for reverting)
repl: revert 81ea52a to fix newlines in copy-paste
thefourtheye commentedon Sep 18, 2015
@silverwind Sorry, I was out playing badminton :D Please take a look at the commit log of the bug fix and let me know if that has to be improved.
repl: backslash bug fix
repl: backslash bug fix
silverwind commentedon Sep 22, 2015
Fixed by fcfd87d
repl: backslash bug fix