diff options
author | Bryan English <bryan@bryanenglish.com> | 2017-09-23 11:40:35 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-10-24 00:35:51 +0300 |
commit | e1cff102f454b9474586d3f77fee38389b78d005 (patch) | |
tree | 8ab1b8fb2103c343e8ed1073e56982f12a49e5e3 /doc | |
parent | 7e1a187df17b7ebad6ac977a374f0b138f98f43e (diff) |
tty,doc: add type-check to isatty
Previously, various inputs other than non-negative integers would
produce incorrect results.
Added type-checking on input, returning false for anything other than
non-negative integers.
Also clarified in docs.
PR-URL: https://github.com/nodejs/node/pull/15567
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/tty.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/tty.md b/doc/api/tty.md index 2950eb6db1a..baa31ac8f0b 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -123,4 +123,5 @@ added: v0.5.8 * `fd` {number} A numeric file descriptor The `tty.isatty()` method returns `true` if the given `fd` is associated with -a TTY and `false` if is not. +a TTY and `false` if it is not, including whenever `fd` is not a non-negative +integer. |