Fixes #37
Node.js bug (#18) regressed again in v5.6.0, it is fixed in v6.2.0.
This commit is contained in:
parent
66d294e992
commit
c719316327
2 changed files with 5 additions and 4 deletions
|
@ -270,8 +270,9 @@ function _readlineSync(options) {
|
||||||
if (IS_WIN) {
|
if (IS_WIN) {
|
||||||
// iojs-v2.3.2+ input stream can't read first line. (#18)
|
// iojs-v2.3.2+ input stream can't read first line. (#18)
|
||||||
// ** Don't get process.stdin before check! **
|
// ** Don't get process.stdin before check! **
|
||||||
// Fixed v5.1.0 https://nodejs.org/en/blog/release/v5.1.0/
|
// Fixed v5.1.0
|
||||||
// Fixed v4.2.4 (LTS) https://nodejs.org/en/blog/release/v4.2.4/
|
// Fixed v4.2.4
|
||||||
|
// It regressed again in v5.6.0, it is fixed in v6.2.0.
|
||||||
verNum = (function(ver) { // getVerNum
|
verNum = (function(ver) { // getVerNum
|
||||||
var nums = ver.replace(/^\D+/, '').split('.');
|
var nums = ver.replace(/^\D+/, '').split('.');
|
||||||
var verNum = 0;
|
var verNum = 0;
|
||||||
|
@ -280,7 +281,7 @@ function _readlineSync(options) {
|
||||||
if ((nums[2] = +nums[2])) { verNum += nums[2]; }
|
if ((nums[2] = +nums[2])) { verNum += nums[2]; }
|
||||||
return verNum;
|
return verNum;
|
||||||
})(process.version);
|
})(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.isTTY) {
|
||||||
process.stdin.pause();
|
process.stdin.pause();
|
||||||
fdR = process.stdin.fd;
|
fdR = process.stdin.fd;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "readline-sync",
|
"name": "readline-sync",
|
||||||
"version": "1.4.2",
|
"version": "1.4.3",
|
||||||
"title": "readlineSync",
|
"title": "readlineSync",
|
||||||
"description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).",
|
"description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
Loading…
Reference in a new issue