From 3d14a9a0272f3abd0c3bffd31a89df4313d4dd54 Mon Sep 17 00:00:00 2001 From: anseki Date: Sat, 27 Jul 2019 21:55:29 +0900 Subject: [PATCH] Adjust for new `constants`. --- lib/readline-sync.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/readline-sync.js b/lib/readline-sync.js index f34579d..97f15f8 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -269,6 +269,9 @@ function _readlineSync(options) { if (!fsB) { fsB = process.binding('fs'); // For raw device path constants = process.binding('constants'); + // for v6.3.0+ + constants = constants && constants.fs && typeof constants.fs.O_RDWR === 'number' + ? constants.fs : constants; } return fsB; }