FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

util: add inspection getter option by BridgeAR · Pull Request #24852 · nodejs/node · GitHub

/ node Public

util: add inspection getter option - #24852

Closed
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:inspect-getters
Closed

util: add inspection getter option#24852
BridgeAR wants to merge 1 commit into
nodejs:masterfrom
BridgeAR:inspect-getters

Conversation

BridgeAR commented Dec 5, 2018

Copy link
Copy Markdown
Member

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

BridgeAR added the semver-minor PRs that contain new features and should be released in the next minor version. label Dec 5, 2018

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Dec 5, 2018
Comment thread doc/api/util.md Outdated
Comment thread lib/internal/util/inspect.js Outdated

Fishrock123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems fine

Comment thread doc/api/util.md Outdated

BridgeAR commented Dec 5, 2018

Copy link
Copy Markdown
Member Author

BridgeAR added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Dec 5, 2018

Trott commented Dec 5, 2018

Copy link
Copy Markdown
Member

Needs a rebase.

devsnek commented Dec 5, 2018

Copy link
Copy Markdown
Member

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

BridgeAR commented Dec 5, 2018

Copy link
Copy Markdown
Member Author

@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 commented Dec 6, 2018
edited
Loading

Copy link
Copy Markdown
Member

@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 commented Dec 6, 2018

Copy link
Copy Markdown
Member Author

@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 commented Dec 6, 2018

Copy link
Copy Markdown
Member Author

Rebased due to conflicts.

CI https://ci.nodejs.org/job/node-test-pull-request/19280/

BridgeAR commented Dec 7, 2018
edited
Loading

Copy link
Copy Markdown
Member Author

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.

Trott commented Dec 8, 2018

Copy link
Copy Markdown
Member

Trott commented Dec 9, 2018

Copy link
Copy Markdown
Member

Trott commented Dec 9, 2018

Copy link
Copy Markdown
Member

Trott commented Dec 9, 2018
edited by BridgeAR
Loading

Copy link
Copy Markdown
Member

Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/19347/ ✔️

danbev commented Dec 12, 2018

Copy link
Copy Markdown
Contributor

Landed in f194b7f.

danbev closed this Dec 12, 2018
danbev pushed a commit that referenced this pull request Dec 12, 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.

PR-URL: #24852
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BethGriggs pushed a commit that referenced this pull request Dec 17, 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.

PR-URL: #24852
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
BethGriggs mentioned this pull request Dec 18, 2018
BethGriggs added a commit that referenced this pull request Dec 18, 2018
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 pushed a commit that referenced this pull request Dec 18, 2018
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
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
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 pushed a commit to refack/node that referenced this pull request Jan 14, 2019
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 pushed a commit to refack/node that referenced this pull request Jan 14, 2019
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
BridgeAR deleted the inspect-getters branch January 20, 2020 11:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL