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 multiline input with user eval function #2939

Closed
blakeembrey opened this issue Sep 18, 2015 · 2 comments
Closed

Support multiline input with user eval function #2939

blakeembrey opened this issue Sep 18, 2015 · 2 comments
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.

Comments

@blakeembrey
Copy link
Contributor

Currently, the node repl module has the capability to do multiline input when the error is an instanceof Recoverable. Unfortunately, the constructor is not exported from the repl module which results in hacky ways to achieve a multi-line REPL experience like node. By exporting the error constructor, consumers could create their own recoverable instances to function identical to before and have multi-line input work naturally.

References:

if (e instanceof Recoverable) {
, nodejs/node-v0.x-archive#8640, babel/babel#1741, TypeStrong/ts-node#3

Edit: Mostly a question, if it's reasonable to add I can issue a PR for a one-line export change.

@brendanashworth brendanashworth added repl Issues and PRs related to the REPL subsystem. feature request Issues that request new features to be added to Node.js. labels Sep 18, 2015
@smasher164
Copy link

Fix for multiline input when using custom eval function @ nodejs/node-v0.x-archive#25587

@mikeybox
Copy link

@blakeembrey Exporting recoverable might be a simpler solution to what I was proposing in my pull request and I think simple is good. I guess we need some input as to which would be preferred. I think it would be good to submit your pull request 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. repl Issues and PRs related to the REPL subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants