summaryrefslogtreecommitdiff
path: root/doc/api/util.md
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-04 22:58:56 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-12-12 05:30:02 +0100
commitf194b7f6261b065726b2850582b4969059b64fa1 (patch)
tree05b06854c31c9f3ad8b2996e2f2298edff9241dc /doc/api/util.md
parent2e4a163012d9a960f014935272cd279e5e72a93b (diff)
downloadandroid-node-v8-f194b7f6261b065726b2850582b4969059b64fa1.tar.gz
android-node-v8-f194b7f6261b065726b2850582b4969059b64fa1.tar.bz2
android-node-v8-f194b7f6261b065726b2850582b4969059b64fa1.zip
util: add inspection getter option
Currently it is not possible to inspect getters. To prevent any side effects this should not become a default but under lots of circumstances it would still be useful to inspect getters. This way it is possible to actively opt into inspecting those. PR-URL: https://github.com/nodejs/node/pull/24852 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/util.md')
-rw-r--r--doc/api/util.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/util.md b/doc/api/util.md
index 8c21bef9ae..0b9e477394 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -389,6 +389,9 @@ stream.write('With ES6');
<!-- YAML
added: v0.3.0
changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/24852
+ description: The `getters` option is supported now.
- version: v11.4.0
pr-url: https://github.com/nodejs/node/pull/24326
description: The `depth` default changed back to `2`.
@@ -468,6 +471,11 @@ changes:
of an object and Set and Map entries will be sorted in the returned string.
If set to `true` the [default sort][] is going to be used. If set to a
function, it is used as a [compare function][].
+ * `getters` {boolean|string} If set to `true`, getters are going to be
+ inspected as well. If set to `'get'` only getters without setter are going
+ to be inspected. If set to `'set'` only getters having a corresponding
+ setter are going to be inspected. This might cause side effects depending on
+ the getter function. **Default:** `false`.
* Returns: {string} The representation of passed object
The `util.inspect()` method returns a string representation of `object` that is