From 19374fd25bac95c80e1eb877668f6b16affc36a2 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Mon, 9 Apr 2018 23:02:08 +0530 Subject: [PATCH] fs: improve argument handling for ReadStream Improve handling of erratic arguments in fs.ReadStream Refs: https://github.com/nodejs/node/pull/19732 PR-URL: https://github.com/nodejs/node/pull/19898 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina Reviewed-By: Ron Korving Reviewed-By: Ruben Bridgewater --- doc/api/fs.md | 5 ++ lib/fs.js | 55 +++++++++++----- test/parallel/test-fs-read-stream-inherit.js | 4 +- .../test-fs-read-stream-throw-type-error.js | 66 ++++++++++++++----- test/parallel/test-fs-read-stream.js | 4 +- 5 files changed, 96 insertions(+), 38 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 286ffb3a63fb3a..b0c1d5fa63d4d8 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1299,6 +1299,11 @@ fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);