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

readline: numeric strings converted to integers in cursorTo #13271

Closed
wants to merge 2 commits into from

Conversation

petekeller2
Copy link

Attempt to convert x and y in cursorTo to integers if they are not of type number

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

readline

@nodejs-github-bot nodejs-github-bot added the readline Issues and PRs related to the built-in readline module. label May 28, 2017
@mscdex
Copy link
Contributor

mscdex commented May 29, 2017

Why would we want to support this? I would consider passing non-number values to be an error.

@petekeller2
Copy link
Author

To make cursorTo easier to work with. A variable equal to a numeric string might be passed in by mistake. An error message for this case might be better though.

@mscdex
Copy link
Contributor

mscdex commented May 29, 2017

I think throwing would be better than interpreting strings in this case.

@jasnell
Copy link
Member

jasnell commented Jun 2, 2017

I'm not a big fan of this approach either. I'm +1 on just throwing a TypeError if the input is not a number already.

@petekeller2
Copy link
Author

I'll close this one since there are a lot of open pull requests

@petekeller2 petekeller2 closed this Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants