Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Multiline input doesn't work if user overrides "eval" in REPL.start #8640

Closed
zenparsing opened this issue Oct 28, 2014 · 6 comments
Closed

Comments

@zenparsing
Copy link

As of b517500, multiline input is triggered when the eval callback is executed with an instance of Recoverable. However, Recoverable is not exported from the "repl" module. It is therefore no longer possible (AFAICT) to trigger multiline input when overriding "eval" in REPL.start.

@zenparsing zenparsing changed the title Multiline input in REPL doesn't work if user overrides "eval" Multiline input doesn't work if user overrides "eval" in REPL.start Oct 28, 2014
@jasnell
Copy link
Member

jasnell commented Jun 3, 2015

@zenparsing ... I know it's been a while, but could you provide a simple test case that demonstrates the problem?

@mikeybox
Copy link

I've run in to the same problem which is caused a number of users of Babel - (#1741) to report the issue. The exact issue is that the finish callback function requires the error passed to have been wrapped in a RecoverableError object which is only available in the repl scope. I'm submitting a pull request to make this more generic allowing the recoverableError check to be passed as an option. This should allow other libraries to modify what passes as recoverable.

mikeybox pushed a commit to mikeybox/node that referenced this issue Jun 28, 2015
…errides "eval" in REPL.start

Overriding default eval will stop multiline inputs on syntax errors because of the current error checking in the
finish callback. This fixes that issue and allows for a custom recoverable check function to be passed the the REPL server
mikeybox pushed a commit to mikeybox/node that referenced this issue Jun 28, 2015
Multiline input doesn't work if user overrides "eval" in
REPL.start. Overriding default eval will stop multiline
inputs on syntax errors because of the current error checking
in the finish callback.

This fixes that issue and allows for a custom recoverableError
check function to be passed the the REPL server for more
customisable use.

fixes nodejs#8640
@mikeybox
Copy link

@jasnell I created a pull request that has had no traction. Do you know anything about this issue and it being resolved?

@davidchambers
Copy link

Thanks for submitting a fix, @mikeybox! I hope the pull request gets some attention soon.

@ggentzke
Copy link

FWIW babel-node with node version 0.12 and beyond (latest tested was v5.0.0) still does not support multiline function definitions. This issue is a blocker for that functionality.

@ghost
Copy link

ghost commented Dec 27, 2015

I cannot use babel-node because of this issue.

@Trott Trott closed this as completed Apr 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants