Skip to content
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

Where the Node console gets confused if constructor is an accessor #636

Open
erights opened this issue Mar 25, 2021 · 1 comment
Open

Where the Node console gets confused if constructor is an accessor #636

erights opened this issue Mar 25, 2021 · 1 comment
Assignees
Labels
kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024

Comments

@erights
Copy link
Contributor

erights commented Mar 25, 2021

Following in the vscode debugger, I found where the Node inspector gets confused if a constructor is an accessor rather than data property. In something/internal/util/inspect.js I see

    const descriptor = ObjectGetOwnPropertyDescriptor(obj, 'constructor');
    if (descriptor !== undefined &&
        typeof descriptor.value === 'function' &&
        descriptor.value.name !== '' &&
        tmp instanceof descriptor.value) {

@bmeck @michaelfig @kumavis @kriskowal Where do I find the actual source for this, so I can file a PR to fix this to work with constructors than have been made accessors in order to work around the override mistake?

@kumavis this is why {errorTaming: 'unsafe', consoleTaming: 'unsafe'} causes the built-in node console to print those errors as {}. Try changing to {errorTaming: 'unsafe', consoleTaming: 'unsafe', overrideTaming: 'min'} and you'll see your stack traces. Try changing to

{
  errorTaming: 'unsafe', 
  consoleTaming: 'unsafe', 
  overrideTaming: 'min',
  stackFiltering: 'verbose',
}

and you'll see the full original stack traces.

Btw, I strongly recommend against {consoleTaming: 'unsafe'}. Is there a reason you want to turn that on?

@erights erights self-assigned this Mar 25, 2021
@erights erights changed the title Where the Node console gets confused is constructor is an accessor Where the Node console gets confused if constructor is an accessor Mar 25, 2021
@erights
Copy link
Contributor Author

erights commented Dec 1, 2021

See #944

@kriskowal kriskowal added the kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024 label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kriskowal-review-2024-01 Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024
Projects
None yet
Development

No branches or pull requests

2 participants