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

custom promisify implementation for readline #37

Merged
merged 1 commit into from May 9, 2021

Conversation

a7ul
Copy link
Contributor

@a7ul a7ul commented May 8, 2021

Fixes #36

Custom promisify fixes the issue with readline breaking in node <= v15.7.0

This might be happening because readline's question function has a callback function. And instead of returning error in the first argument it has the answer itself ?

  • Tests pass
  • Appropriate changes to README are included in PR

@google-cla
Copy link

google-cla bot commented May 8, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@a7ul
Copy link
Contributor Author

a7ul commented May 8, 2021

@googlebot I signed it!

@a7ul a7ul changed the title custom promisify implementation custom promisify implementation for readline May 8, 2021
@a7ul
Copy link
Contributor Author

a7ul commented May 8, 2021

Yep the support for promisification of readline question was only added in node v15.8.0
See here: nodejs/node@19981ed
Related pr here: nodejs/node#33676

So this patch solves it for all version before node v15.8.0 and after too.
I tested this in node v15.7.0 without this patch and the issue still pops up.

index.mjs Outdated Show resolved Hide resolved
adds backwards compatibility instead

removes ;

Revert "adds backwards compatibility instead"

This reverts commit bf1b5b7.
@antonmedv antonmedv merged commit bf94e38 into google:main May 9, 2021
@a7ul a7ul deleted the fix-promisify branch May 9, 2021 12:43
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

Successfully merging this pull request may close these issues.

Question function is throwing the value you type in (node <= v15.7.0)
2 participants