New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: add inspection getter option #24852

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
8 participants
@BridgeAR
Copy link
Member

BridgeAR commented Dec 5, 2018

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Show resolved Hide resolved doc/api/util.md Outdated
@Fishrock123
Copy link
Member

Fishrock123 left a comment

Seems fine

Show resolved Hide resolved doc/api/util.md Outdated
@BridgeAR

This comment has been minimized.

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 5, 2018

Needs a rebase.

@devsnek

This comment has been minimized.

Copy link
Member

devsnek commented Dec 5, 2018

wouldn't this be better suited for the custom inspect symbol? i feel like this is too blunt a sword.

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Dec 5, 2018

@devsnek in what way? The default is set to off. In most code we do not check for the descriptors at all and just access the properties. In util.inspect we are more conservative and only allow direct access with an option.

@devsnek

This comment has been minimized.

Copy link
Member

devsnek commented Dec 6, 2018

@BridgeAR i'm just trying to imagine when i would personally use this, and the answer is either "something weird i don't own" in which case i wouldn't want to just willy-nilly trigger accessors, or something i own, in which case i would just add a custom inspect symbol.

an alternative to this could be using v8 side effect detection in the default inspector

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Dec 6, 2018

@devsnek I see your point but I still see further use cases and it is easier to use this option than writing a custom inspection function each time. I personally would like to use this while having customInspect = false and inside assert since we don't pay attention to getters when comparing objects and in that case the error output is not as it should be.

@BridgeAR BridgeAR force-pushed the BridgeAR:inspect-getters branch from ebf86d3 to 9a77f25 Dec 6, 2018

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Dec 6, 2018

@BridgeAR

This comment has been minimized.

Copy link
Member

BridgeAR commented Dec 7, 2018

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.

@BridgeAR BridgeAR force-pushed the BridgeAR:inspect-getters branch from 9a77f25 to d7b15c1 Dec 8, 2018

@Trott

This comment has been minimized.

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 9, 2018

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 9, 2018

@Trott

This comment has been minimized.

Copy link
Member

Trott commented Dec 9, 2018

@danbev

This comment has been minimized.

Copy link
Member

danbev commented Dec 12, 2018

Landed in f194b7f.

@danbev danbev closed this Dec 12, 2018

danbev added a commit that referenced this pull request Dec 12, 2018

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: #24852
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

@addaleax addaleax referenced this pull request Dec 15, 2018

Open

util: prevent leaking inspect internals #24971

4 of 4 tasks complete

BethGriggs added a commit that referenced this pull request Dec 17, 2018

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: #24852
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

BethGriggs added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **test**:
  * test TLS client authentication (Sam Roberts)
    [#24733](#24733)
* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **tools**:
  * update ESLint to 5.10.0 (cjihrig)
    [#24903](#24903)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

@BethGriggs BethGriggs referenced this pull request Dec 18, 2018

Merged

V11.5.0 proposal #25102

BethGriggs added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **test**:
  * test TLS client authentication (Sam Roberts)
    [#24733](#24733)
* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **tools**:
  * update ESLint to 5.10.0 (cjihrig)
    [#24903](#24903)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

PR-URL: #25102

MylesBorins added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **test**:
  * test TLS client authentication (Sam Roberts)
    [#24733](#24733)
* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **tools**:
  * update ESLint to 5.10.0 (cjihrig)
    [#24903](#24903)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

PR-URL: #25102

BethGriggs added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **tools**:
  * update ESLint to 5.10.0 (cjihrig)
    [#24903](#24903)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

PR-URL: #25102

BethGriggs added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

PR-URL: #25102

BethGriggs added a commit that referenced this pull request Dec 18, 2018

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [#24733](#24733)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [#24852](#24852)

PR-URL: #25102

refack added a commit to refack/node that referenced this pull request Jan 14, 2019

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: nodejs#24852
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

refack added a commit to refack/node that referenced this pull request Jan 14, 2019

2018-12-18, Version 11.5.0 (Current)
Notable changes:

* **tls**:
  * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts)
    [nodejs#24733](nodejs#24733)
* **util**:
  * add inspection getter option (Ruben Bridgewater)
    [nodejs#24852](nodejs#24852)

PR-URL: nodejs#25102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment