Skip to content
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

Support for multilines #15

Closed
antsmartian opened this issue Jul 18, 2018 · 3 comments
Closed

Support for multilines #15

antsmartian opened this issue Jul 18, 2018 · 3 comments

Comments

@antsmartian
Copy link
Contributor

antsmartian commented Jul 18, 2018

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#L68

Not 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.

@antsmartian
Copy link
Contributor Author

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

@devsnek
Copy link
Member

devsnek commented Jul 18, 2018

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

@antsmartian
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants