Skip to content

Commit

Permalink
fs: remove dirent.path
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Nov 6, 2024
1 parent f38cefa commit f819bc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 39 deletions.
7 changes: 5 additions & 2 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3615,6 +3615,9 @@ Please use `value instanceof WebAssembly.Module` instead.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55548
description: End-of-Life.
- version: v23.0.0
pr-url: https://github.com/nodejs/node/pull/51050
description: Runtime deprecation.
Expand All @@ -3626,9 +3629,9 @@ changes:
description: Documentation-only deprecation.
-->

Type: Runtime
Type: End-of-Life

The [`dirent.path`][] is deprecated due to its lack of consistency across
The [`dirent.path`][] has been removed due to its lack of consistency across
release lines. Please use [`dirent.parentPath`][] instead.

### DEP0179: `Hash` constructor
Expand Down
25 changes: 0 additions & 25 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6811,31 +6811,6 @@ added:
The path to the parent directory of the file this {fs.Dirent} object refers to.
#### `dirent.path`
<!-- YAML
added:
- v20.1.0
- v18.17.0
deprecated:
- v21.5.0
- v20.12.0
- v18.20.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55547
description: The property is no longer read-only.
- version: v23.0.0
pr-url: https://github.com/nodejs/node/pull/51050
description: Accessing this property emits a warning. It is now read-only.
-->
> Stability: 0 - Deprecated: Use [`dirent.parentPath`][] instead.
* {string}
Alias for `dirent.parentPath`.
### Class: `fs.FSWatcher`
<!-- YAML
Expand Down
12 changes: 0 additions & 12 deletions lib/internal/fs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,6 @@ for (const name of ReflectOwnKeys(Dirent.prototype)) {
};
}

ObjectDefineProperty(Dirent.prototype, 'path', {
__proto__: null,
get: deprecate(function() {
return this.parentPath;
}, 'dirent.path is deprecated in favor of dirent.parentPath', 'DEP0178'),
set(value) {
setOwnProperty(this, 'path', value);
},
configurable: true,
enumerable: false,
});

function copyObject(source) {
const target = {};
for (const key in source)
Expand Down

0 comments on commit f819bc1

Please sign in to comment.