Skip to content

Conversation

@Renegade334
Copy link
Member

The existing description in errors.md is outdated as of v21.x:

  • The hidden internal stack trace property is set at construct time, and is no longer lazily generated.
  • The accessors now perform a brand check, and do nothing if the this value passed to the getter/setter is not a native error.

This behaviour isn't mentioned in V8/Chromium documentation nor MDN, so it's worth spelling out here.

Error.isError() doesn't exist in v22.x, so this will need a specific PR referencing util.types.isNativeError() instead.

Refs: #60862

@Renegade334 Renegade334 added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. labels Dec 16, 2025
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Dec 16, 2025
@aduh95
Copy link
Contributor

aduh95 commented Dec 17, 2025

Should we mention https://github.com/tc39/proposal-error-stack-accessor, which I think is what triggered the change in V8?

@Renegade334
Copy link
Member Author

@ljharb reckon this is mature enough to reference on our side?


`error.stack` is a getter/setter for a hidden internal property which is only
present on builtin `Error` objects (those for which [`Error.isError`][] returns
true). If `error` is not a builtin error object, then the `error.stack` getter
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
true). If `error` is not a builtin error object, then the `error.stack` getter
`true`). If `error` is not a builtin error object, then the `error.stack` getter

@ljharb
Copy link
Member

ljharb commented Dec 26, 2025

I think it’s probably fine, but still best to wait for stage 2.7 at least.

@Renegade334 Renegade334 requested a review from legendecas January 3, 2026 14:55
@legendecas
Copy link
Member

I think this describes the status quo. This does not need to wait or be blocked by https://github.com/tc39/proposal-error-stack-accessor.

@legendecas legendecas added lts-watch-v22.x PRs that may need to be released in v22.x lts-watch-v24.x PRs that may need to be released in v24.x and removed backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. labels Jan 5, 2026
@Renegade334 Renegade334 added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 9, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 9, 2026
@nodejs-github-bot nodejs-github-bot merged commit a327288 into nodejs:main Jan 9, 2026
27 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a327288

aduh95 pushed a commit that referenced this pull request Jan 9, 2026
PR-URL: #61090
Refs: #60862
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. errors Issues and PRs related to JavaScript errors originated in Node.js core. lts-watch-v22.x PRs that may need to be released in v22.x lts-watch-v24.x PRs that may need to be released in v24.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants