summaryrefslogtreecommitdiff
path: root/ext/fs/30_fs.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-01-26 23:19:00 +0100
committerGitHub <noreply@github.com>2024-01-26 23:19:00 +0100
commit6109717c4a4d8139fdbf7165aac3bff2722e16d2 (patch)
treeed87d3b3daedceb759b5bf376ecd77ae9cc5a35c /ext/fs/30_fs.js
parent942fb5e0388eab02f98c02541a3f90053afd59d1 (diff)
refactor: make 'rid' properties non-enumerable (#22137)
Now these props will not show up when inspecting objects in console.
Diffstat (limited to 'ext/fs/30_fs.js')
-rw-r--r--ext/fs/30_fs.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/fs/30_fs.js b/ext/fs/30_fs.js
index 35a9d304b..ea89feda1 100644
--- a/ext/fs/30_fs.js
+++ b/ext/fs/30_fs.js
@@ -83,6 +83,7 @@ const {
Function,
MathTrunc,
ObjectEntries,
+ ObjectDefineProperty,
ObjectPrototypeIsPrototypeOf,
ObjectValues,
StringPrototypeSlice,
@@ -656,14 +657,16 @@ function create(path) {
}
class FsFile {
- [internalRidSymbol] = 0;
#rid = 0;
#readable;
#writable;
constructor(rid, symbol) {
- this[internalRidSymbol] = rid;
+ ObjectDefineProperty(this, internalRidSymbol, {
+ enumerable: false,
+ value: rid,
+ });
this.#rid = rid;
if (!symbol || symbol !== SymbolFor("Deno.internal.FsFile")) {
internals.warnOnDeprecatedApi(