Node.js bug (#18) regressed again in v5.6.0, it is fixed in v6.2.0.
This commit is contained in:
anseki 2016-06-04 21:18:42 +09:00
parent 66d294e992
commit c719316327
2 changed files with 5 additions and 4 deletions

View file

@ -270,8 +270,9 @@ function _readlineSync(options) {
if (IS_WIN) {
// iojs-v2.3.2+ input stream can't read first line. (#18)
// ** Don't get process.stdin before check! **
// Fixed v5.1.0 https://nodejs.org/en/blog/release/v5.1.0/
// Fixed v4.2.4 (LTS) https://nodejs.org/en/blog/release/v4.2.4/
// Fixed v5.1.0
// Fixed v4.2.4
// It regressed again in v5.6.0, it is fixed in v6.2.0.
verNum = (function(ver) { // getVerNum
var nums = ver.replace(/^\D+/, '').split('.');
var verNum = 0;
@ -280,7 +281,7 @@ function _readlineSync(options) {
if ((nums[2] = +nums[2])) { verNum += nums[2]; }
return verNum;
})(process.version);
if (!(verNum >= 20302 && verNum < 40204 || verNum >= 50000 && verNum < 50100) &&
if (!(verNum >= 20302 && verNum < 40204 || verNum >= 50000 && verNum < 50100 || verNum >= 50600 && verNum < 60200) &&
process.stdin.isTTY) {
process.stdin.pause();
fdR = process.stdin.fd;

View file

@ -1,6 +1,6 @@
{
"name": "readline-sync",
"version": "1.4.2",
"version": "1.4.3",
"title": "readlineSync",
"description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).",
"keywords": [