Visitar URL original
fs: use private fields instead of symbols for `Dir` by pluris · Pull Request #51037 · nodejs/node · GitHub
The Wayback Machine - https://web.archive.org/web/20231224182826/https://github.com/nodejs/node/pull/51037
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

fs: use private fields instead of symbols for Dir #51037

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pluris
Copy link
Contributor

@pluris pluris commented Dec 4, 2023

A small refactor to replace Symbols with private properties.

Refs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Dec 4, 2023
lib/internal/fs/dir.js Outdated Show resolved Hide resolved
lib/internal/fs/dir.js Outdated Show resolved Hide resolved
@aduh95 aduh95 added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 5, 2023
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonrig
Copy link
Member

anonrig commented Dec 12, 2023

@aduh95 Why is this semver-major?

}

[kDirReadImpl](maybeSync, callback) {
if (this[kDirClosed] === true) {
#dirReadImpl(maybeSync, callback) {
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
#dirReadImpl(maybeSync, callback) {
#readImpl(maybeSync, callback) {

@aduh95
Copy link
Contributor

aduh95 commented Dec 12, 2023

@aduh95 Why is this semver-major?

It changes the error thrown by e.g. calling Dir.prototype.read().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants