repl: handling multiline history needs some case guards

  • Version: master
  • Platform: Windows 7 x64
  • Subsystem: repl
  1. Recently added REPL multiline history handling streamlines multiline expressions into one-line expressions, but line comments may change syntax and hang execution:
> [
...   1 // comment
... ]
[ 1 ]
> [  1 // comment]
...

This is relevant if someone pastes copied code blocks with line comments in the REPL. It seems comments need to be stripped.

  1. Another case that needs special handling, multiline template literals:
> `a
... b
... c`
'a\nb\nc'
> bc`
...

cc @antsmartian