From e802ae32421f40c7d6434445fa81bb682e69975c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 16 Nov 2018 16:48:05 -0800 Subject: [PATCH 1/2] doc: include undefined in os.cpus() return values Document that `os.cpus()` can return `undefined` if information about cores is not available. This can happen particularly on unsupported platforms like Android. Fixes: https://github.com/nodejs/node/issues/19022 --- doc/api/os.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/os.md b/doc/api/os.md index ad5736d7690016..3ef1932b84cdea 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -54,10 +54,10 @@ defined are described in [OS Constants](#os_os_constants_1). added: v0.3.3 --> -* Returns: {Object[]} +* Returns: {Object[]|undefined} -The `os.cpus()` method returns an array of objects containing information about -each logical CPU core. +Returns an array of objects containing information about each logical CPU core. +If the information is not available, `os.cpus()` will return `undefined`. The properties included on each object include: From 79044efe3b39c1ab2590e1620f36d62adeee03c9 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 16 Nov 2018 18:13:58 -0800 Subject: [PATCH 2/2] fixup! doc: include undefined in os.cpus() return values --- doc/api/os.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/os.md b/doc/api/os.md index 3ef1932b84cdea..2ac18573236ce9 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -57,7 +57,7 @@ added: v0.3.3 * Returns: {Object[]|undefined} Returns an array of objects containing information about each logical CPU core. -If the information is not available, `os.cpus()` will return `undefined`. +On unsupported platforms such as Android, `os.cpus()` may return `undefined`. The properties included on each object include: