Closed antsmartian closed 6 years ago
May be we need to buffer the statements and check if the error is recoverable? Like we do at our node currently : https://github.com/nodejs/node/blob/master/lib/repl.js#L1510
we should probably use acorn or something to determine if the input is invalid or unfinished (> a: 5 }
vs > { a: 5
), and then we can just drop to the next line waiting for more input
Yes I thought about acorn
. May, be I can give it a try in my free time and try to raise a PR. Thanks for your input.
Hello,
Looks like the current repl doesn't support multiline expression. I was looking at the source code, guess we are passing the expression to
Runtime.evaluate
over here : https://github.com/nodejs/repl/blob/master/src/repl.js#L68Not sure, whether the session's
Runtime.evaluate
supports multilines. But looking at the protocol from here: https://chromium.googlesource.com/v8/v8/+/master/src/inspector/js_protocol.json, I doubt it has the support.